gh-136880: Add warning about PYTHONPATH#151098
Conversation
See conversation here: python#136880 for the request for this documentation update.
replace with simple highlighting
Documentation build overview
21 files changed ·
|
There was a problem hiding this comment.
Where do you get that PYTHONHOME is managed by the activated venv?
$ python3.14 -m venv /tmp/foo
$ echo $PYTHONHOME
$ source /tmp/foo/bin/activate
$ echo $PYTHONHOMEI don't think the first sentence is correct. You could validly say "Note that activating a virtual environment does not alter the PYTHONPATH ..."
That was the guidance I received in the issue, see #136880 (comment) . I'm perfectly fine with your suggested change. |
Clarified that the activated virtual environment does not alter the PYTHONPATH variable.
Reformat note about PYTHONPATH and virtual environments for clarity.
remove trailing whitespace
|
Thanks @glennglazer for the PR, and @vsajip for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
|
Thanks @glennglazer for the PR, and @vsajip for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
Thanks @glennglazer for the PR, and @vsajip for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
GH-151298 is a backport of this pull request to the 3.13 branch. |
|
GH-151299 is a backport of this pull request to the 3.15 branch. |
|
GH-151300 is a backport of this pull request to the 3.14 branch. |
Warn people that PYTHONPATH is inherited in the venv, this can produce unexpected results such as the wrong library version (if system is different than venv requirements) or even completely incompatible references.