diff options
author | Phil Elson <pelson.pub@gmail.com> | 2022-10-19 14:49:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-19 14:49:34 (GMT) |
commit | 1a6bacb31f7b49c244a6cc3ff0fa7f71a82412ef (patch) | |
tree | 8c94eda8dce456ca0f2254a0395d7e69b19b557a /Doc/using | |
parent | 50553004fe12dcaed3aa9a96b356eb84f247c8fd (diff) | |
download | cpython-1a6bacb31f7b49c244a6cc3ff0fa7f71a82412ef.zip cpython-1a6bacb31f7b49c244a6cc3ff0fa7f71a82412ef.tar.gz cpython-1a6bacb31f7b49c244a6cc3ff0fa7f71a82412ef.tar.bz2 |
[doc] Refresh the venv introduction documentation, and correct the statement about VIRTUAL_ENV (GH-98350)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Diffstat (limited to 'Doc/using')
-rw-r--r-- | Doc/using/venv-create.inc | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/Doc/using/venv-create.inc b/Doc/using/venv-create.inc index c2a9f52..fd8cc01 100644 --- a/Doc/using/venv-create.inc +++ b/Doc/using/venv-create.inc @@ -105,45 +105,3 @@ Multiple paths can be given to ``venv``, in which case an identical virtual environment will be created, according to the given options, at each provided path. -Once a virtual environment has been created, it can be "activated" using a -script in the virtual environment's binary directory. The invocation of the -script is platform-specific (`<venv>` must be replaced by the path of the -directory containing the virtual environment): - -+-------------+-----------------+-----------------------------------------+ -| Platform | Shell | Command to activate virtual environment | -+=============+=================+=========================================+ -| POSIX | bash/zsh | $ source <venv>/bin/activate | -+-------------+-----------------+-----------------------------------------+ -| | fish | $ source <venv>/bin/activate.fish | -+-------------+-----------------+-----------------------------------------+ -| | csh/tcsh | $ source <venv>/bin/activate.csh | -+-------------+-----------------+-----------------------------------------+ -| | PowerShell Core | $ <venv>/bin/Activate.ps1 | -+-------------+-----------------+-----------------------------------------+ -| Windows | cmd.exe | C:\\> <venv>\\Scripts\\activate.bat | -+-------------+-----------------+-----------------------------------------+ -| | 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 -installed scripts without having to use their full path. However, all scripts -installed in a virtual environment should be runnable without activating it, -and run with the virtual environment's Python automatically. - -You can deactivate a virtual environment by typing "deactivate" in your shell. -The exact mechanism is platform-specific and is an internal implementation -detail (typically a script or shell function will be used). - -.. versionadded:: 3.4 - ``fish`` and ``csh`` activation scripts. - -.. versionadded:: 3.8 - PowerShell activation scripts installed under POSIX for PowerShell Core - support. |