- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to install a custom python library for a app with a lot of dependencies?
Hi,
Hope you'll are having a great day!
Coming to the question: How can I install Python libraries for usage in scripts under an app?
Basically, I have created an external lookup script, and it requires the following modules:
msgraph-sdk, azure-identity
I easily installed them for testing on my local system by using pip. Now I want to make it work on Splunk.
I researched a bit, and pretty much all the solutions mainly say to create a lib folder under etc/apps/<appName>/lib
And then copy and paste the external library folder in there.
The thing is, these libraries have a lot of dependencies with them, which get auto-installed when we do it with pip install.
So my question is, does there exist a more sophisticated and straightforward way to install these large libraries without copy-pasting potentially 100s of libraries?
Any help would be appreciated!
Thank youu,
Best,
Jay
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

This is about PIP install, not Splunk search. (And perhaps more suited for All Apps and Add-ons and Installation forums.) A little googling shows https://stackoverflow.com/a/2916320/17164801 by Ian Bicking.
Use:
pip install --install-option="--prefix=$PREFIX_PATH" package_name
You might also want to use --ignore-installed to force all dependencies to be reinstalled using this new prefix. You can use --install-option to multiple times to add any of the options you can use with python setup.py install (--prefix is probably what you want, but there are a bunch more options you could use).
Hope this helps.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Alright, thanks a lot for the help.
Appreciate the help and advice for the right forum.
Have a nice day.
