[3.15] gh-136880: Add warning about PYTHONPATH (GH-151098) (GH-151299)

(cherry picked from commit 84630e2cb9)
This commit is contained in:
Miss Islington (bot) 2026-06-11 08:38:03 +02:00 committed by GitHub
parent e8d914fd49
commit f3316ca675
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -88,6 +88,11 @@ For example:
'~/envs/tutorial-env/lib/python3.5/site-packages']
>>>
Note that the activated virtual environment does not alter the ``PYTHONPATH`` variable in any way.
This may lead to unexpected results if the path includes references to code which is incompatible with
the Python version the virtual environment is using. The best practice is to ``unset PYTHONPATH``
in bash or the equivalent for the shell you are using.
To deactivate a virtual environment, type::
deactivate