<?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: Issue with python module when executing python script form splunk in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Issue-with-python-module-when-executing-python-script-form/m-p/210105#M69030</link>
    <description>&lt;P&gt;It's telling you it can't find the stats module in the  scypi library in your splunk_home/etc/apps/search/bin directory.  Put it there and the error will go away.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Sep 2016 10:24:18 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2016-09-22T10:24:18Z</dc:date>
    <item>
      <title>Issue with python module when executing python script form splunk</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Issue-with-python-module-when-executing-python-script-form/m-p/210104#M69029</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1897i45A9E503A6FCC723/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Here is the snapshot of the issue which I can c from job inspector and my below script is working fine in python environment but not in splunk&lt;/P&gt;

&lt;P&gt;**import random&lt;BR /&gt;
import sys&lt;/P&gt;

&lt;H1&gt;import scipy as sc&lt;/H1&gt;

&lt;P&gt;import scipy.stats as sct&lt;BR /&gt;
x = sys.argv&lt;A href="https://answers.splunk.comstorage/temp/159231-issue.jpg"&gt;1&lt;/A&gt;&lt;BR /&gt;
def ran_w():&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;z= []
k= []
for i in range(0,int(x)):
    z =random.random()
    k =sct.norm.ppf
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(z,loc=197.265217391304,scale=33.1340303880203)&lt;BR /&gt;
        print("Random Number")&lt;BR /&gt;
        print(z)&lt;BR /&gt;
        print("IND Value")&lt;BR /&gt;
        print(k)&lt;/P&gt;

&lt;P&gt;ran_w()**&lt;/P&gt;

&lt;P&gt;Kindly help me... and thanks in advance..&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 09:19:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Issue-with-python-module-when-executing-python-script-form/m-p/210104#M69029</guid>
      <dc:creator>ygkr</dc:creator>
      <dc:date>2016-09-22T09:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with python module when executing python script form splunk</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Issue-with-python-module-when-executing-python-script-form/m-p/210105#M69030</link>
      <description>&lt;P&gt;It's telling you it can't find the stats module in the  scypi library in your splunk_home/etc/apps/search/bin directory.  Put it there and the error will go away.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 10:24:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Issue-with-python-module-when-executing-python-script-form/m-p/210105#M69030</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-09-22T10:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with python module when executing python script form splunk</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Issue-with-python-module-when-executing-python-script-form/m-p/210106#M69031</link>
      <description>&lt;P&gt;jkat54 thanks for the response and will u plz elobrate on putting the module into splunk bin directory as of now I saved my python script in bin and running it from search bar but I can c my output for the script in Anaconda IDE... I m new to python thats y m asking u to eloborate... the things like where to download the package and how to install that in bin folder of splunk....&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 10:40:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Issue-with-python-module-when-executing-python-script-form/m-p/210106#M69031</guid>
      <dc:creator>ygkr</dc:creator>
      <dc:date>2016-09-22T10:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with python module when executing python script form splunk</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Issue-with-python-module-when-executing-python-script-form/m-p/210107#M69032</link>
      <description>&lt;P&gt;Consider this image of a app/bin directory that I have for an Azure - Splunk integration:&lt;/P&gt;

&lt;P&gt;tableService.py imports dateutil and azure.  These libraries are not packaged with Splunk's python.  So i have to put them here in the bin directory in order to use "import dateutil" in my python script tableService.py.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1896iF64628A84413B0E6/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 13:08:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Issue-with-python-module-when-executing-python-script-form/m-p/210107#M69032</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-09-22T13:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with python module when executing python script form splunk</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Issue-with-python-module-when-executing-python-script-form/m-p/210108#M69033</link>
      <description>&lt;P&gt;One piece maybe you're missing is instead of testing the script just with "python script.py",  you use "splunk cmd python script.py"  This causes splunk to do a couple important things that end up mirroring how Splunk will run your script later.  One of these things is putting $SPLUNK_HOME/bin in pythonpath so it can see the files you're trying to import. &lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 15:25:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Issue-with-python-module-when-executing-python-script-form/m-p/210108#M69033</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2016-09-22T15:25:24Z</dc:date>
    </item>
  </channel>
</rss>

