<?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: python path in script in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/python-path-in-script/m-p/599087#M104476</link>
    <description>&lt;P&gt;Any Python script that Splunk runs will use the Splunk-supplied Python interpreter.&amp;nbsp; That ensures the script runs in a Splunk-compatible environment.&lt;/P&gt;</description>
    <pubDate>Tue, 24 May 2022 14:17:40 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2022-05-24T14:17:40Z</dc:date>
    <item>
      <title>python path in script</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/python-path-in-script/m-p/599054#M104465</link>
      <description>&lt;P&gt;Hello colleagues&lt;/P&gt;&lt;P&gt;I have a python file. which I add to Data inputs -&amp;gt; script&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Set the interval, set up, the file itself works&lt;/P&gt;&lt;P&gt;but the initial path starts with /opt/splunk/bin/python.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/bin/python&amp;nbsp; /.../.../file.py&lt;BR /&gt;&lt;BR /&gt;help pls!!&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 12:27:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/python-path-in-script/m-p/599054#M104465</guid>
      <dc:creator>gitingua</dc:creator>
      <dc:date>2022-05-24T12:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: python path in script</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/python-path-in-script/m-p/599058#M104466</link>
      <description>&lt;P&gt;Could you elaborate your question a bit, if possible? What is it that you are seeking? The issue?&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 12:34:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/python-path-in-script/m-p/599058#M104466</guid>
      <dc:creator>shivanshu1593</dc:creator>
      <dc:date>2022-05-24T12:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: python path in script</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/python-path-in-script/m-p/599060#M104467</link>
      <description>&lt;P&gt;I need to tell the python script to run pythonpath=/bin /splunk&lt;BR /&gt;but not /opt/splunk/bin/splunk&lt;BR /&gt;&lt;BR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/61125"&gt;@shivanshu1593&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 12:39:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/python-path-in-script/m-p/599060#M104467</guid>
      <dc:creator>gitingua</dc:creator>
      <dc:date>2022-05-24T12:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: python path in script</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/python-path-in-script/m-p/599063#M104468</link>
      <description>&lt;P&gt;As a workaround, could you try adding the following to the script and see if it helps.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;import sys
sys.path.append('/bin/splunk') #You can modify the path as per your requirement.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 12:43:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/python-path-in-script/m-p/599063#M104468</guid>
      <dc:creator>shivanshu1593</dc:creator>
      <dc:date>2022-05-24T12:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: python path in script</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/python-path-in-script/m-p/599078#M104472</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/61125"&gt;@shivanshu1593&lt;/a&gt;&amp;nbsp; not working&lt;/P&gt;&lt;P&gt;still starts through /opt/splunk/bin/python&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 13:17:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/python-path-in-script/m-p/599078#M104472</guid>
      <dc:creator>gitingua</dc:creator>
      <dc:date>2022-05-24T13:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: python path in script</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/python-path-in-script/m-p/599087#M104476</link>
      <description>&lt;P&gt;Any Python script that Splunk runs will use the Splunk-supplied Python interpreter.&amp;nbsp; That ensures the script runs in a Splunk-compatible environment.&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 14:17:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/python-path-in-script/m-p/599087#M104476</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-05-24T14:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: python path in script</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/python-path-in-script/m-p/599096#M104478</link>
      <description>&lt;P&gt;Well, Splunk related scripts are executed from $SPLUNK_HOME/bin/python to maintain the compatibility with the environment. You can specify the libraries inside the /bin directory of your app, if you have external libraries' dependency. If sys.append.path didn't work, then unfortunately you'll have to make do with Splunk's path.&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 14:52:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/python-path-in-script/m-p/599096#M104478</guid>
      <dc:creator>shivanshu1593</dc:creator>
      <dc:date>2022-05-24T14:52:47Z</dc:date>
    </item>
  </channel>
</rss>

