Is it possible to install a python package (e.g. xgboost) in the Python for Scientific Computing interpreter app?
I managed to add extra python modules to Python for Scientific Computing by building it from source.
In my case I added xgboost for Linux (64-bit)
Cloned the GitHub repo: https://github.com/splunk/Splunk-python-for-scientific-computing
Just for increased stability I checked out the latest available git tag (currently 4.2.1, this step might not be necessary)
I then added in environment.nix.yml the python module that I want (in my case: - xgboost=2.1.1)
Afterwards, followed the readme and run: make freeze make build make dist
Finally copied the tarball from the build directory to the user_apps directory on Splunk (substituting the existing Python for Scientific Computing app if already installed).
When using Python for Scientific Computing copy the exec_anaconda and util python scripts to the bin directory of your app. Also copy the lib/splunklib from Python for Scientific Computing to the bin directory of your app.
Add these lines to the start of your script:
import exec_anaconda
exec_anaconda.exec_anaconda()
Hi gwobben,
I think it is possible to install additional python packages into the app with some manual compile and build work, but Splunk does not support nor recommend doing this.
Thanks!
Hunter
Due to the passage of time, I'll put this here: https://answers.splunk.com/answers/497850/machine-learning-toolkit-is-there-documentation-ab.html
Hi Hunters,
Thanks for the reply. Let me rephrase: HOW can I install additional packages? I'm not really looking to recompile the entire thing but it would be nice to use Python imports.
Have you found out how to this already? I am curious as well.
No you just can't.. I've chosen a different route by running my python code on a different (docker) machine with an API.