I'm going through and writing a setup doc for other developers at work for a python project and I've been reading up on the PYTHONPATH
environment variable. I'm looking at my current development system and think I have a few things set wrong that is causing my IDE (IntelliJ) to behave incorrectly when looking up the python libraries.
I've looked at the documentation here and here and I'm still unsure of what should actually be in the PYTHONPATH
environment variable.
I have PYTHONHOME
pointed to `C:Python27'.
My current PYTHONPATH
is set to PYTHONHOME
. Should I also add the directories from sys.path
?
UPDATE:
Based on the below information, PYTHONPATH
does not need to be set unless there are non-standard libraries that you want python to be able to find by default. For instance, when I install wxPython from the installer it will add its libraries to PYTHONPATH
. I do set PYTHONHOME
to the root of the python installation so that I can add it to my system PATH
environment variable so that I can run python from any where.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…