Project

General

Profile

Development Environment » History » Version 2

Luke Murphey, 03/17/2012 06:02 PM

1 1 Luke Murphey
h1. Development Environment
2 1 Luke Murphey
3 1 Luke Murphey
h2. Setting Up Python
4 1 Luke Murphey
5 2 Luke Murphey
Python in Splunk 4.3 generates an error unless the PYTHONPATH environment variable is defined. This makes it difficult to make Eclipse use Splunk's Python since Eclipse tries to run Python when initializing it. You can get Eclipse to load Splunk's Python by adding a batch script to Splunk's bin directory with the following:
6 1 Luke Murphey
7 1 Luke Murphey
<pre>
8 1 Luke Murphey
@echo off
9 1 Luke Murphey
"C:\Program Files\Splunk\bin\splunk.exe" cmd python %*
10 1 Luke Murphey
</pre>
11 1 Luke Murphey
12 2 Luke Murphey
Tell Eclipse to load the batch file and it should load fine. Alternatively, you can call "setSplunkEnv":http://splunk-base.splunk.com/answers/3405/python-example-fails before running Python to set the necessary parameters.