Whenever I use sys.path.append
, the new directory will be added. However, once I close python, the list will revert to the previous (default?) values. How do I
For me it worked when I changed the .bash_profile
file. Just changing .bashrc
file worked only till I restarted the shell.
For python 2.7 it should look like:
export PYTHONPATH="$PYTHONPATH:/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python"
at the end of the .bash_profile
file.