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!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

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