]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[doc] Document VIRTUAL_ENV environment variable (GH-21970)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 30 Jan 2021 10:38:44 +0000 (02:38 -0800)
committerGitHub <noreply@github.com>
Sat, 30 Jan 2021 10:38:44 +0000 (02:38 -0800)
(cherry picked from commit 3584d4b64a5373440f78237eac734831cfd83f79)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
Doc/using/venv-create.inc

index 5e724cd5794ce48a38929aa467998bc5c456c7b3..ddb36f94667d9f5e5d83b302217b91acf33c16b1 100644 (file)
@@ -126,6 +126,10 @@ directory containing the virtual environment):
 |             | PowerShell      | PS C:\\> <venv>\\Scripts\\Activate.ps1  |
 +-------------+-----------------+-----------------------------------------+
 
+When a virtual environment is active, the :envvar:`VIRTUAL_ENV` environment
+variable is set to the path of the virtual environment. This can be used to
+check if one is running inside a virtual environment.
+
 You don't specifically *need* to activate an environment; activation just
 prepends the virtual environment's binary directory to your path, so that
 "python" invokes the virtual environment's Python interpreter and you can run