Installation

pytz python package not working in splunk

Rajkumarkbm2
Explorer

I have a python script which will acquire the data from the url and index that in splunk.

Now i have included from pytz import timezone in the script to get the local time of the timezone and passin that time as a input to the url.

Now the issue is while i configured that script in the Splunk i am getting ImportError: No module named pytz

Please help me to resolve this.

Tags (1)
0 Karma

PowerPacked
Builder

Hi @Rajkumarkbm2

Have a look at this answer,
https://answers.splunk.com/answers/484369/how-can-i-add-python-modules-to-the-splunk-environ-1.html

Usually, Splunk uses the python Interpreter & libraries which comes with it & resides in $SplunkHome$/lib/python2.7/site-packages.

& also you can use sys.path.append in script to import modules into your python file from different locations.

Thanks

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...