]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-136880: Add warning about PYTHONPATH (GH-151098)
authorglennglazer <glenn.glazer@gmail.com>
Thu, 11 Jun 2026 06:14:34 +0000 (23:14 -0700)
committerGitHub <noreply@github.com>
Thu, 11 Jun 2026 06:14:34 +0000 (07:14 +0100)
Doc/tutorial/venv.rst

index f362e1943b666f7b053bed08a1bb4a1df9851f83..6b6b8a768e3f58d0218d0dde2592b91c0997d96d 100644 (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