diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2012-07-03 16:26:55 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2012-07-03 16:26:55 (GMT) |
commit | 3575f910d964a18d06ec3b2a989763801892916e (patch) | |
tree | bab26a891897c090c5684eec035624dc49fd3d2f /Doc/using | |
parent | 3874e547b4779978952792bc19c438c28daca125 (diff) | |
download | cpython-3575f910d964a18d06ec3b2a989763801892916e.zip cpython-3575f910d964a18d06ec3b2a989763801892916e.tar.gz cpython-3575f910d964a18d06ec3b2a989763801892916e.tar.bz2 |
Closes #15241: Added information on venv prefixes to pyvenv section.
Diffstat (limited to 'Doc/using')
-rw-r--r-- | Doc/using/scripts.rst | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Doc/using/scripts.rst b/Doc/using/scripts.rst index 2d28246..8968847 100644 --- a/Doc/using/scripts.rst +++ b/Doc/using/scripts.rst @@ -63,3 +63,25 @@ Multiple paths can be given to ``pyvenv``, in which case an identical virtualenv will be created, according to the given options, at each provided path. +.. note:: A virtual environment (also called a ``venv``) is a Python + environment such that the Python interpreter, libraries and scripts + installed into it are isolated from those installed in other virtual + environments, and (by default) any libraries installed in a "system" Python, + i.e. one which is installed as part of your operating system. + + A venv is a directory tree which contains Python executable files and + other files which indicate that it is a venv. + + Common installation tools such as ``distribute`` and ``pip`` work as + expected with venvs - i.e. when a venv is active, they install Python + packages into the venv without needing to be told to do so explicitly. + + When a venv is active (i.e. the venv's Python interpreter is running), the + attributes :attr:`sys.prefix` and :attr:`sys.exec_prefix` point to the base + directory of the venv, whereas :attr:`sys.base_prefix` and + :attr:`sys.base_exec_prefix` point to the non-venv Python installation + which was used to create the venv. If a venv is not active, then + :attr:`sys.prefix` is the same as :attr:`sys.base_prefix` and + :attr:`sys.exec_prefix` is the same as :attr:`sys.base_exec_prefix` (they + all point to a non-venv Python installation). + |