From 8628b43b204605cd431a01dc31b832af0d84a9de Mon Sep 17 00:00:00 2001 From: glennglazer Date: Mon, 8 Jun 2026 10:48:22 -0700 Subject: [PATCH 1/2] Add warning about PYTHONPATH See conversation here: https://github.com/python/cpython/issues/136880 for the request for this documentation update. --- Doc/tutorial/venv.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/tutorial/venv.rst b/Doc/tutorial/venv.rst index f362e1943b666f7..d19ce866cbd68dc 100644 --- a/Doc/tutorial/venv.rst +++ b/Doc/tutorial/venv.rst @@ -88,6 +88,8 @@ For example: '~/envs/tutorial-env/lib/python3.5/site-packages'] >>> +Note that the activated virtual environment manages the :term:`PYTHONHOME` environment variable to find the specific version of Python that is requested. It does not alter the :term:`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 From 431f247acf72360c408ab40327eaf4d22cdc9bf7 Mon Sep 17 00:00:00 2001 From: glennglazer Date: Mon, 8 Jun 2026 11:23:34 -0700 Subject: [PATCH 2/2] remove undefined terms replace with simple highlighting --- Doc/tutorial/venv.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/tutorial/venv.rst b/Doc/tutorial/venv.rst index d19ce866cbd68dc..3cd6a397d0e04ec 100644 --- a/Doc/tutorial/venv.rst +++ b/Doc/tutorial/venv.rst @@ -88,7 +88,7 @@ For example: '~/envs/tutorial-env/lib/python3.5/site-packages'] >>> -Note that the activated virtual environment manages the :term:`PYTHONHOME` environment variable to find the specific version of Python that is requested. It does not alter the :term:`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. +Note that the activated virtual environment manages the ``PYTHONHOME`` environment variable to find the specific version of Python that is requested. It 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::