All Apps and Add-ons

Install packages in the Python for Scientific Computing interpreter

gwobben
Communicator

Is it possible to install a python package (e.g. xgboost) in the Python for Scientific Computing interpreter app?

garrets
Loves-to-Learn

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()

 

 

0 Karma

hunters_splunk
Splunk Employee
Splunk Employee

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

0 Karma

efavreau
Motivator

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

###

If this reply helps you, an upvote would be appreciated.
0 Karma

gwobben
Communicator

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.

0 Karma

JosIJntema
Explorer

Have you found out how to this already? I am curious as well.

0 Karma

gwobben
Communicator

No you just can't.. I've chosen a different route by running my python code on a different (docker) machine with an API.

0 Karma
Get Updates on the Splunk Community!

Developer Spotlight with William Searle

The Splunk Guy: A Developer’s Path from Web to Cloud William is a Splunk Professional Services Consultant with ...

Major Splunk Upgrade – Prepare your Environment for Splunk 10 Now!

Attention App Developers: Test Your Apps with the Splunk 10.0 Beta and Ensure Compatibility Before the ...

Stay Connected: Your Guide to June Tech Talks, Office Hours, and Webinars!

What are Community Office Hours?Community Office Hours is an interactive 60-minute Zoom series where ...