Creation of virtual environments - Isolation

“A virtual environment is created on top of an existing Python installation, known as the virtual environment’s “base” Python, and may optionally be isolated from the packages in the base environment, so only those explicitly installed in the virtual environment are available.”

However, PEP 405 – Python Virtual Environments | peps.python.org says “By default, a virtual environment is entirely isolated from the system-level site-packages directories.”

The phrase “may be optionally isolated” can mislead beginners and create confusion, especially for people trying to understand how environments work. The environment is isolated by default, and no options are needed to disable isolation. A better phrasing could be: “may optionally have isolation disabled” or “may optionally be allowed access to global packages.”

2 Likes

I’ve noticed this before too. How about splitting the sentence?:

“A virtual environment is created on top of an existing Python installation, known as the virtual environment’s “base” Python. By default a virtual environment is isolated from the packages in its base environment, so only those explicitly installed in the virtual environment are available.”

3 Likes

Hello! Thanks for taking the time to report the confusion in the docs! I created a PR to improve them, following the direction of what @JamesParrott suggested… take a look here

2 Likes