]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[doc] Document VIRTUAL_ENV environment variable (GH-21970)
authorAndre Delfino <adelfino@gmail.com>
Tue, 1 Sep 2020 06:07:29 +0000 (03:07 -0300)
committerGitHub <noreply@github.com>
Tue, 1 Sep 2020 06:07:29 +0000 (07:07 +0100)
Doc/using/venv-create.inc

index c8f6e8f87d5674dfe15efe7976e34901cc7f77a6..8f850a74d413ce25c9b2151148164cdcd8c53398 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