Jupyter notebook wrong path
<p>I need to test a few functions from a code I am building which I import into a jupyter notebook.</p>

<p>issue is, <em>simTools_path</em> is different in the functions and the jupyter notebook. More, when I call these functions from my main python script, it works fine.</p>

<p><strong>MWE</strong></p>

<p><em>simTools_path/objects/classes.py</em></p>

<pre><code>simTools_path = os.path.abspath(os.getenv('SIMTOOLS_PATH'))
sys.path.append(simTools_path)

def testPath():
    print 'testPath', simTools_path
</code></pre>

<p><em>jupyter notebook</em></p>

<pre><code>import os,sys
# paths 
simTools_path = os.path.abspath('../')
os.environ["SIMTOOLS_PATH"] = "simTools_path"
os.environ["PYTHONPATH"] = "simTools_path"
sys.path.append(simTools_path)

from objects.classes import testPath

print simTools_path
testPath()
</code></pre>

<p>results:</p>

<pre><code>simTools_path= /home/jhumberto/WORK/Projects/code/simulations_2016-07-14/simTools
testPath= /home/jhumberto/WORK/Projects/code/simulations_2016-07-14/simTools/jupyterNotebooks/simTools_path
</code></pre>

<p><em>Notes:</em></p>

<p>1) I use this path variable in different functions inside different modules to load file data relatively to the <em>simTools_path</em> path.</p>

<p>2) my jupyter notebook is located in <em>/home/jhumberto/WORK/Projects/code/simulations_2016-07-14/simTools/jupyterNotebooks</em></p>

<p>Any ideas?</p>