Skip to content Skip to sidebar Skip to footer

How To Set Pythonpath To Multiple Folders

In ~/.bash_profile file (OS X) I've set PYTHONPATH to point to two folders: export PYTHONPATH=/Applications/python/common:$PYTHONPATH export PYTHONPATH=/Applications/sitecustomize:

Solution 1:

Append your paths so there is only one PYTHONPATH.

PYTHONPATH="/Applications/python/common:/Applications/sitecustomize:$PYTHONPATH"export PYTHONPATH

Then source ~/.bash_profile

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

import sys
sys.path.append("/Applications/python/common")
sys.path.append("/Applications/sitecustomize")

Post a Comment for "How To Set Pythonpath To Multiple Folders"