You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation of sys.base_prefix states that "base_prefix and base_exec_prefix will remain pointing to the base Python installation (the one which the virtual environment was created from)"
In the case of creating one virtual environment from another:
sys.base_prefix in bar points to the system Python installation, not to foo. (Tested on Windows). I believe this behaviour is better, and I'm suspect that existing tools rely on it, but regardless of what is correct behaviour, the documentation should be more explicit about what the expected value of sys.base_prefix is in a virtual environment created from another virtual environment.
Also, given that the behaviour is documented as being (at least in part) implemented in site.py, the behaviour when the -S flag ("don't import site") is supplied to Python should be documented as well.
The text was updated successfully, but these errors were encountered:
Documentation of the sys module
The documentation of
sys.base_prefix
states that "base_prefix and base_exec_prefix will remain pointing to the base Python installation (the one which the virtual environment was created from)"In the case of creating one virtual environment from another:
sys.base_prefix
inbar
points to the system Python installation, not to foo. (Tested on Windows). I believe this behaviour is better, and I'm suspect that existing tools rely on it, but regardless of what is correct behaviour, the documentation should be more explicit about what the expected value ofsys.base_prefix
is in a virtual environment created from another virtual environment.Also, given that the behaviour is documented as being (at least in part) implemented in
site.py
, the behaviour when the-S
flag ("don't import site") is supplied to Python should be documented as well.The text was updated successfully, but these errors were encountered: