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
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...