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
Adding export PYTHONPATH="${PYTHONPATH}:/my/other/path"
to the ~/.bashrc might not work if PYTHONPATH
does not currently exist (because of the :
).
export PYTHONPATH="/my/other/path1"
export PYTHONPATH="${PYTHONPATH}:/my/other/path2"
Adding the above to my ~/.bashrc did the trick for me on Ubuntu 16.04