https://github.com/python/cpython/commit/bbdd3e5e720f4f42c46c7da61af043cf9aa8eaff
commit: bbdd3e5e720f4f42c46c7da61af043cf9aa8eaff
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: vsajip <[email protected]>
date: 2026-06-11T07:37:38+01:00
summary:

[3.14] gh-136880: Add warning about PYTHONPATH (GH-151098) (GH-151300)

(cherry picked from commit 84630e2cb90ef334e41eb9bccd860b3b0a7ff51b)

files:
M Doc/tutorial/venv.rst

diff --git a/Doc/tutorial/venv.rst b/Doc/tutorial/venv.rst
index f362e1943b666f7..6b6b8a768e3f58d 100644
--- a/Doc/tutorial/venv.rst
+++ b/Doc/tutorial/venv.rst
@@ -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

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to