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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...