On my machine, the values ββfrom PYTHONPATH displayed in sys.path :
- starting at index 1
- saved order
- de-duplicated
For example, with PYTHONPATH=/spam:/eggs:/spam , and then in python -m site , I get a result like:
sys.path = [ something, '/spam', '/eggs', more, stuff, after ]
It seems that this behavior is in Python 2 and Python 3. The question is, how is this PYTHONPATH processing documented / reliable, and what if it can be different on other platforms? Is it baked in the interpreter or processed by site.py and / or can be "modified" by system administrators?
I do not see this in the documentation here , it just says that sys.path "augmented" (and contrary to the documentation, non-existent directories do not seem to be ignored).
python environment-variables python-import
wim
source share