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
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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...