<?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: How to use a different Python Version? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419564#M7356</link>
    <description>&lt;P&gt;We've had to move away from Python Virtual environments activate process that Pyden is using (proved to be a very unstable integration process with Splunk)&lt;/P&gt;

&lt;P&gt;**But the solution appears to be using Python Subprocess module.  Here is a post describing our implementation.  &lt;A href="https://answers.splunk.com/answers/744353/use-a-different-python-version-with-subprocess.html#answer-744354"&gt;link text&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Apr 2019 19:26:14 GMT</pubDate>
    <dc:creator>jrouse025</dc:creator>
    <dc:date>2019-04-30T19:26:14Z</dc:date>
    <item>
      <title>How to have Splunk call my custom Python script that is using a different version/installation of Python?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419558#M7350</link>
      <description>&lt;P&gt;How can I have Splunk call my custom python script that is using a different version/installation of python?&lt;/P&gt;
&lt;P&gt;Requirements:&lt;BR /&gt;a. Windows 2012&lt;BR /&gt;b. do not want to modify the splunk python 2.7&lt;BR /&gt;c. My Python install location d:\mypython&lt;BR /&gt;d. Splunk can call script d:\Splunk\etc\apps\search\bin\mycustompassthrough.py&lt;BR /&gt;e. search results passed in&lt;BR /&gt;f. results passed back to splunk&lt;/P&gt;
&lt;P&gt;Thanks for any assistance..cheers.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 23:11:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419558#M7350</guid>
      <dc:creator>jrouse025</dc:creator>
      <dc:date>2020-06-17T23:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a different Python Version?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419559#M7351</link>
      <description>&lt;P&gt;Would &lt;A href="https://splunkbase.splunk.com/app/4322/"&gt;PyDev&lt;/A&gt; help here ? If not you could use a wrapper script in Windows to call your python command and that should work...&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 23:10:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419559#M7351</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2019-01-21T23:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a different Python Version?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419560#M7352</link>
      <description>&lt;P&gt;Thank you for the suggestion,  at first glance it appears it may do the job.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 13:05:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419560#M7352</guid>
      <dc:creator>jrouse025</dc:creator>
      <dc:date>2019-01-22T13:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a different Python Version?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419561#M7353</link>
      <description>&lt;P&gt;@gjanders thank you for your suggestion.  The PyDev application was a good idea to gain some inspiration to move to using python virtual environments (which is exactly what we did).&lt;BR /&gt;
Here how you can be successful: &lt;/P&gt;

&lt;P&gt;Given: custom command running your python script&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Prep:&lt;/STRONG&gt; &lt;BR /&gt;
1. Create a python virtual environment (see python documentation site)&lt;A href="https://docs.python.org/3/library/venv.html"&gt;link text&lt;/A&gt;&lt;BR /&gt;
2. Install needed modules into your python virtual environment&lt;BR /&gt;
3. Update your python script to use the Activate/activation method (see python documentation)&lt;A href="https://docs.python-guide.org/dev/virtualenvs/"&gt;link text&lt;/A&gt;&lt;BR /&gt;
&lt;STRONG&gt;You could also look at how PyDen works for further inspiration&lt;/STRONG&gt;&lt;BR /&gt;
SUCCESS! Our script will now run inside the custom python environment that contains its needed modules without having to modify Splunk.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 15:04:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419561#M7353</guid>
      <dc:creator>jrouse025</dc:creator>
      <dc:date>2019-04-01T15:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a different Python Version?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419562#M7354</link>
      <description>&lt;P&gt;@jrouse25 perhaps you can answer your question with the above comment and accept it? Glad you found a solution&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 20:41:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419562#M7354</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2019-04-01T20:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a different Python Version?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419563#M7355</link>
      <description>&lt;P&gt;@gjanders thank you for your suggestion. The PyDev application was a good idea to gain some inspiration to move to using python virtual environments (which is exactly what we did).&lt;BR /&gt;
Here how you can be successful:&lt;/P&gt;

&lt;P&gt;Given: custom command running your python script&lt;/P&gt;

&lt;P&gt;Prep: &lt;BR /&gt;
1. Create a python virtual environment (see python documentation site)link text&lt;BR /&gt;
2. Install needed modules into your python virtual environment&lt;BR /&gt;
3. Update your python script to use the Activate/activation method (see python documentation)link text&lt;BR /&gt;
You could also look at how PyDen works for further inspiration&lt;BR /&gt;
SUCCESS! Our script will now run inside the custom python environment that contains its needed modules without having to modify Splunk.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 12:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419563#M7355</guid>
      <dc:creator>jrouse025</dc:creator>
      <dc:date>2019-04-02T12:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a different Python Version?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419564#M7356</link>
      <description>&lt;P&gt;We've had to move away from Python Virtual environments activate process that Pyden is using (proved to be a very unstable integration process with Splunk)&lt;/P&gt;

&lt;P&gt;**But the solution appears to be using Python Subprocess module.  Here is a post describing our implementation.  &lt;A href="https://answers.splunk.com/answers/744353/use-a-different-python-version-with-subprocess.html#answer-744354"&gt;link text&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 19:26:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419564#M7356</guid>
      <dc:creator>jrouse025</dc:creator>
      <dc:date>2019-04-30T19:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a different Python Version?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419565#M7357</link>
      <description>&lt;P&gt;The particular process I used for PyDen to activate virtual environments has a known bug for Windows. There's a work around available but since PyDen doesn't support Windows currently for other reasons I haven't included it in the app.&lt;/P&gt;

&lt;P&gt;Additionally, PyDen does not utilize Intersplunk or any other Splunk libraries because one of its goals was to support Python3 which is incompatible with the internal Splunk libraries.&lt;/P&gt;

&lt;P&gt;These, I think, are the two main integration issues probably experienced.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 06:32:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419565#M7357</guid>
      <dc:creator>badarsebard</dc:creator>
      <dc:date>2019-06-07T06:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a different Python Version?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419566#M7358</link>
      <description>&lt;P&gt;Worst case scenario most python 3.x features have been back-ported to python 2.7.x. and you can add any needed libraries to the splunk install if needed. &lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2019 19:12:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-have-Splunk-call-my-custom-Python-script-that-is-using-a/m-p/419566#M7358</guid>
      <dc:creator>hallt3</dc:creator>
      <dc:date>2019-06-07T19:12:09Z</dc:date>
    </item>
  </channel>
</rss>

