<?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: User environment's PYTHONHOME variable is preventing splunk to startup properly in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/User-environment-s-PYTHONHOME-variable-is-preventing-splunk-to/m-p/370810#M6054</link>
    <description>&lt;P&gt;Hello, I had this situation when the Splunk tgz wasn't fully extracted. I haven't used anything of the solution above&lt;/P&gt;</description>
    <pubDate>Mon, 27 May 2019 12:49:53 GMT</pubDate>
    <dc:creator>OL</dc:creator>
    <dc:date>2019-05-27T12:49:53Z</dc:date>
    <item>
      <title>User environment's PYTHONHOME variable is preventing splunk to startup properly</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/User-environment-s-PYTHONHOME-variable-is-preventing-splunk-to/m-p/370807#M6051</link>
      <description>&lt;P&gt;I encountered a scenario where one of our hosts have customized python 2.7, and a user on that host has PYTHONHOME set in its environment whenever logged in. &lt;BR /&gt;
It looks like PYTHONHOME set for the user has interfered with splunk's bundled python package. When the user starts splunk, it would fail to load the proper python modules (ImportError: No module named site).&lt;BR /&gt;
By default, splunk seems to set its bundled python to use bundled libraries, and prefix &amp;amp; exec_prefix are set to splunk installation directory. But with PYTHONHOME set, splunk python linked the libraries from customized python location, which causes it to fail.&lt;/P&gt;

&lt;P&gt;Is there a way to override the PYTHONHOME variable in splunk, upon startup?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 23:07:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/User-environment-s-PYTHONHOME-variable-is-preventing-splunk-to/m-p/370807#M6051</guid>
      <dc:creator>splunkIT</dc:creator>
      <dc:date>2017-03-22T23:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: User environment's PYTHONHOME variable is preventing splunk to startup properly</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/User-environment-s-PYTHONHOME-variable-is-preventing-splunk-to/m-p/370808#M6052</link>
      <description>&lt;P&gt;Since you are overriding both the prefix and exec_prefix by setting PYTHONHOME, you will encounter issues importing modules. You should be able to work around this by defining PYTHONHOME as the value of $SPLUNK_HOME in $SPLUNK_HOME/etc/splunk-launch.conf. This doesn't seem to work with the variable "$SPLUNK_HOME", so you will have to add the absolute path verbatim. You may also have to add PYTHONPATH if that is in your env, but it seems to expand $SPLUNK_HOME without issue.&lt;/P&gt;

&lt;H4&gt;With PYTHONHOME set (incorrectly):&lt;/H4&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="mailto:notroot@localhost.localdomain" target="_blank"&gt;notroot@localhost.localdomain&lt;/A&gt;:/tmp&amp;gt; echo $PYTHONHOME&lt;BR /&gt;
/dev/null&lt;BR /&gt;
&lt;A href="mailto:notroot@localhost.localdomain" target="_blank"&gt;notroot@localhost.localdomain&lt;/A&gt;:/tmp&amp;gt; echo $PYTHONPATH&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;H4&gt;Splunk will not start with python error:&lt;/H4&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="mailto:notroot@localhost.localdomain" target="_blank"&gt;notroot@localhost.localdomain&lt;/A&gt;:/tmp&amp;gt; ./splunk/bin/splunk start --accept-license&lt;BR /&gt;
This appears to be your first time running this version of Splunk.&lt;BR /&gt;
&lt;STRONG&gt;ImportError: No module named site&lt;/STRONG&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;H4&gt;Add PYTHONHOME to splunk-launch.conf&lt;/H4&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="mailto:notroot@localhost.localdomain" target="_blank"&gt;notroot@localhost.localdomain&lt;/A&gt;:/tmp&amp;gt; echo -e '\nPYTHONHOME=/tmp/splunk\n' &amp;gt;&amp;gt; ./splunk/etc/splunk-launch.conf&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;H4&gt;And you should be able to work around the environmental variable being set:&lt;/H4&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="mailto:notroot@localhost.localdomain" target="_blank"&gt;notroot@localhost.localdomain&lt;/A&gt;:/tmp&amp;gt; ./splunk/bin/splunk start --accept-license&lt;BR /&gt;
This appears to be your first time running this version of Splunk.&lt;BR /&gt;
Copying '/tmp/splunk/etc/openldap/ldap.conf.default' to '/tmp/splunk/etc/openldap/ldap.conf'.&lt;BR /&gt;
Generating RSA private key, 1024 bit long modulus&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:22:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/User-environment-s-PYTHONHOME-variable-is-preventing-splunk-to/m-p/370808#M6052</guid>
      <dc:creator>jreuter_splunk</dc:creator>
      <dc:date>2020-09-29T13:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: User environment's PYTHONHOME variable is preventing splunk to startup properly</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/User-environment-s-PYTHONHOME-variable-is-preventing-splunk-to/m-p/370809#M6053</link>
      <description>&lt;P&gt;Assuming that you are on &lt;CODE&gt;linux&lt;/CODE&gt; and are using username &lt;CODE&gt;splunk&lt;/CODE&gt; you can try this:&lt;/P&gt;

&lt;P&gt;Login as user splunk and do these commands:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;cd
echo "export PYTHONHOME=YourValueHere" &amp;gt; ~/.bash_profile
chmod a+x ~/.bash_profile
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You need to know what &lt;CODE&gt;YourValueHere&lt;/CODE&gt; to use but this should cause everything that the &lt;CODE&gt;splunk&lt;/CODE&gt; user does to obtain your hard-coded value.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 23:44:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/User-environment-s-PYTHONHOME-variable-is-preventing-splunk-to/m-p/370809#M6053</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-22T23:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: User environment's PYTHONHOME variable is preventing splunk to startup properly</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/User-environment-s-PYTHONHOME-variable-is-preventing-splunk-to/m-p/370810#M6054</link>
      <description>&lt;P&gt;Hello, I had this situation when the Splunk tgz wasn't fully extracted. I haven't used anything of the solution above&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2019 12:49:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/User-environment-s-PYTHONHOME-variable-is-preventing-splunk-to/m-p/370810#M6054</guid>
      <dc:creator>OL</dc:creator>
      <dc:date>2019-05-27T12:49:53Z</dc:date>
    </item>
  </channel>
</rss>

