All Apps and Add-ons

How to import util when using exec_anaconda?

afdelacruz
Engager

When using the script command, I try to import exec_anaconda in order to use Pandas and Numpy. However, when I run my script it errors out saying,

01-16-2020 11:31:30.707 ERROR ScriptRunner - stderr from 'C:\Program Files\Splunk\bin\Python3.exe C:\Program Files\Splunk\etc\apps\TestCleartiScript\bin\Clearti_v0.2_Splunk.py': from util.base_util import get_apps_path

01-16-2020 11:31:30.707 ERROR ScriptRunner - stderr from 'C:\Program Files\Splunk\bin\Python3.exe C:\Program Files\Splunk\etc\apps\TestCleartiScript\bin\Clearti_v0.2_Splunk.py': ModuleNotFoundError: No module named 'util'

That statement 'from util.base_util import get_apps_path is in the exec_anaconda.py that gets called in the beginning of my script.

1 Solution

C_HIEN
Path Finder

I solved this problem adding the "/bin/util" folder of Splunk MLTK on my app bin path.

View solution in original post

C_HIEN
Path Finder

I solved this problem adding the "/bin/util" folder of Splunk MLTK on my app bin path.

Get Updates on the Splunk Community!

How to Monitor Google Kubernetes Engine (GKE)

We’ve looked at how to integrate Kubernetes environments with Splunk Observability Cloud, but what about ...

Index This | How can you make 45 using only 4?

October 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...

Splunk Education Goes to Washington | Splunk GovSummit 2024

If you’re in the Washington, D.C. area, this is your opportunity to take your career and Splunk skills to the ...