I'm having some trouble understanding how Python uses the
PYTHONPATH environment variable. According to the documentation, the import search path (
sys.path) is "Initialized from the environment variable
PYTHONPATH, plus an installation-dependent default."
In a Windows command box, I started Python (v.2.7.6) and printed the value of
sys.path. I got a list of pathnames, the "installation-dependent default."
Then I quit Python, set
.;./lib;, restarted Python, and printed
os.environ['PYTHONPATH']. I got
.;./lib; as expected. Then I printed
sys.path. I think it should have been the installation-dependent default with
.;./lib; added to the start or the end. Instead it was the installation-dependent default alone, as if
PYTHONPATH were empty. What am I missing here?