How to set PYTHONPATH to multiple folders
<p>In <code>~/.bash_profile</code> file (OS X) I've set PYTHONPATH to point to two folders:</p>

<pre><code>export PYTHONPATH=/Applications/python/common:$PYTHONPATH
export PYTHONPATH=/Applications/sitecustomize:$PYTHONPATH
</code></pre>

<p>Even while <code>sitecustomize</code> folder is set on a second line (after <code>/common</code>) 
the first path is ignored and I am not able to import any module from the path defined in a first line. What needs to be revised in above syntax to make both folders PYTHONPATHish to Python?</p>

<p>Append your paths so there is only one PYTHONPATH.  </p>

<pre><code>PYTHONPATH="/Applications/python/common:/Applications/sitecustomize:$PYTHONPATH"
export PYTHONPATH
</code></pre>

<p>Then <code>source ~/.bash_profile</code></p>

<p>OR import them into your Python script (this would only work for the script added to):</p>

<pre><code>import sys
sys.path.append("/Applications/python/common")
sys.path.append("/Applications/sitecustomize")
</code></pre>

python bash