<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: can PYTHONPATH for splunk be expanded to point to another python lib directory? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/can-PYTHONPATH-for-splunk-be-expanded-to-point-to-another-python/m-p/263919#M3314</link>
    <description>&lt;PRE&gt;&lt;CODE&gt; import sys
 sys.path.append('LOCAL_PYTHON_PATH')
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Add the above to your python script. I have few python scripts that uses local python libraries (redis). I was able to include the libraries with the above.&lt;/P&gt;

&lt;P&gt;If this has resolved your problem, please accept it as answer. &lt;/P&gt;</description>
    <pubDate>Sun, 07 Feb 2016 02:27:03 GMT</pubDate>
    <dc:creator>Murali2888</dc:creator>
    <dc:date>2016-02-07T02:27:03Z</dc:date>
    <item>
      <title>can PYTHONPATH for splunk be expanded to point to another python lib directory?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/can-PYTHONPATH-for-splunk-be-expanded-to-point-to-another-python/m-p/263915#M3310</link>
      <description>&lt;P&gt;I am converting a script that works in my local python to work with splunk and it fails due to missing python libraries that we had added to my lib.  This sort of situation was already discussed here: &lt;A href="https://answers.splunk.com/answers/8/can-i-add-python-modules-to-the-splunk-environment.html"&gt;https://answers.splunk.com/answers/8/can-i-add-python-modules-to-the-splunk-environment.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;However, one option which was never discussed as a solution, but seems easiest to me, is to update the PYTHONPATH to point to my local python's lib directory, either updating the enviroment variable directly or through some splunk configuration.  So long as the python versions are the same, which they are in this case, I would think this would fix the problem, while ensuring that any future libs installed to my local python are immediately available to splunk scripts.&lt;/P&gt;

&lt;P&gt;Is there a reason this is either impossible to do or not a good idea?  I realize it may cause issues if a future splunk upgrade switches over to a new python version of course, though I think all of the suggested solutions in the above answer have similar issues in such a case, so I don't see this solution being any less flexible? &lt;/P&gt;

&lt;P&gt;If there isn't a problem with doing this what is the easiest/cleanest way to update PYTHONPATH for splunk, is there a configuration file somewhere in splunk I can modify to do this?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 21:44:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/can-PYTHONPATH-for-splunk-be-expanded-to-point-to-another-python/m-p/263915#M3310</guid>
      <dc:creator>dsollen</dc:creator>
      <dc:date>2016-02-02T21:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: can PYTHONPATH for splunk be expanded to point to another python lib directory?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/can-PYTHONPATH-for-splunk-be-expanded-to-point-to-another-python/m-p/263916#M3311</link>
      <description>&lt;P&gt;Can you try the below in your python script?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import sys
sys.path.append('LOCAL_PYTHON_PATH')
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have few python scripts that uses local python libraries (redis). I was able to include the libraries with the above.&lt;BR /&gt;
Let me know how you go with this.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 23:12:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/can-PYTHONPATH-for-splunk-be-expanded-to-point-to-another-python/m-p/263916#M3311</guid>
      <dc:creator>Murali2888</dc:creator>
      <dc:date>2016-02-02T23:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: can PYTHONPATH for splunk be expanded to point to another python lib directory?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/can-PYTHONPATH-for-splunk-be-expanded-to-point-to-another-python/m-p/263917#M3312</link>
      <description>&lt;P&gt;If this has resolved your issue, can you accept it as answer and close it?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2016 05:42:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/can-PYTHONPATH-for-splunk-be-expanded-to-point-to-another-python/m-p/263917#M3312</guid>
      <dc:creator>Murali2888</dc:creator>
      <dc:date>2016-02-05T05:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: can PYTHONPATH for splunk be expanded to point to another python lib directory?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/can-PYTHONPATH-for-splunk-be-expanded-to-point-to-another-python/m-p/263918#M3313</link>
      <description>&lt;P&gt;Hi @Murali2888&lt;/P&gt;

&lt;P&gt;Just so you know (since I've seen you mention this in other questions), users can't accept comments as answers. You have to actually post your official response in the "Enter your answer here..." field below if you want someone to accept your answer.&lt;/P&gt;</description>
      <pubDate>Sat, 06 Feb 2016 20:36:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/can-PYTHONPATH-for-splunk-be-expanded-to-point-to-another-python/m-p/263918#M3313</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2016-02-06T20:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: can PYTHONPATH for splunk be expanded to point to another python lib directory?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/can-PYTHONPATH-for-splunk-be-expanded-to-point-to-another-python/m-p/263919#M3314</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; import sys
 sys.path.append('LOCAL_PYTHON_PATH')
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Add the above to your python script. I have few python scripts that uses local python libraries (redis). I was able to include the libraries with the above.&lt;/P&gt;

&lt;P&gt;If this has resolved your problem, please accept it as answer. &lt;/P&gt;</description>
      <pubDate>Sun, 07 Feb 2016 02:27:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/can-PYTHONPATH-for-splunk-be-expanded-to-point-to-another-python/m-p/263919#M3314</guid>
      <dc:creator>Murali2888</dc:creator>
      <dc:date>2016-02-07T02:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: can PYTHONPATH for splunk be expanded to point to another python lib directory?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/can-PYTHONPATH-for-splunk-be-expanded-to-point-to-another-python/m-p/263920#M3315</link>
      <description>&lt;P&gt;Thanks ppablo. I will post the it in the answer section&lt;/P&gt;</description>
      <pubDate>Sun, 07 Feb 2016 02:27:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/can-PYTHONPATH-for-splunk-be-expanded-to-point-to-another-python/m-p/263920#M3315</guid>
      <dc:creator>Murali2888</dc:creator>
      <dc:date>2016-02-07T02:27:27Z</dc:date>
    </item>
  </channel>
</rss>

