All Apps and Add-ons

SplunkIT and python 2.7

sonicZ
Contributor

Hi,

I was working with installing SplunkIT on a host here with Splunk installed, but the system has python 2.4.3
Instead i tried to point SplunkIT to the 2.7.x version of python included with Splunk but received errors about missing modules first the uuid module

-bash-3.2$ /ngs/app/splunkt/splunk/bin/python bin/gendata.py 
Traceback (most recent call last):
  File "bin/gendata.py", line 20, in <module>
    from pyro_server import *
  File "/ngs/app/splunkt/splunk/splunkit/splunkit-server/lib/pyro_server.py", line 17, in <module>
    import Pyro4
  File "/ngs/app/splunkt/splunk/splunkit/splunkit-server/lib/Pyro4/__init__.py", line 67, in <module>
    from Pyro4.core import URI, Proxy, Daemon, callback, batch, async, Future
  File "/ngs/app/splunkt/splunk/splunkit/splunkit-server/lib/Pyro4/core.py", line 9, in <module>
    import logging, uuid
ImportError: No module named uuid

then after i copied over a working uuid module into the splunk dir, it complained about others.
It appears we cannot use the pre-installed 2.7.3 splunk version included with Splunk installations in conjunction with SplunkIT?

Tags (2)
0 Karma
1 Solution

sonicZ
Contributor

I confirmed with the SplunkIT developer that the python version included in splunk even though 2.7.x is stripped down and does not include all the modules necessary.
You will need a full version of python to get the tests working easily, once i got a 2.7.5 instance of python compiled/installed the prebuilt python scripts worked.

View solution in original post

0 Karma

badarsebard
Communicator

As an alternative, there is an Splunk app called PyDen that will allow you to download and compile any version of Python you want, create a virtual environment, and install any PyPI packages you need to the environment. Once that's done you can add an simple import statement to the top of the script that needs the package and it will run under the environment instead of the built-in Splunk Python.

0 Karma

sonicZ
Contributor

I confirmed with the SplunkIT developer that the python version included in splunk even though 2.7.x is stripped down and does not include all the modules necessary.
You will need a full version of python to get the tests working easily, once i got a 2.7.5 instance of python compiled/installed the prebuilt python scripts worked.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...