| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 242c26f commit f9f8e3c
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,6 +50,12 @@ This will create the ``tutorial-env`` directory if it doesn't exist, | |||
| 50 | 50 | and also create directories inside it containing a copy of the Python | |
| 51 | 51 | interpreter, the standard library, and various supporting files. | |
| 52 | 52 | ||
| 53 | + A common directory location for a virtual environment is ``.venv``. | ||
| 54 | + This name keeps the directory typically hidden in your shell and thus | ||
| 55 | + out of the way while giving it a name that explains why the directory | ||
| 56 | + exists. It also prevents clashing with ``.env`` environment variable | ||
| 57 | + definition files that some tooling supports. | ||
| 58 | + | ||
| 53 | 59 | Once you've created a virtual environment, you may activate it. | |
| 54 | 60 | ||
| 55 | 61 | On Windows, run:: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,12 +6,13 @@ command ``venv``:: | |||
| 6 | 6 | Running this command creates the target directory (creating any parent | |
| 7 | 7 | directories that don't exist already) and places a ``pyvenv.cfg`` file in it | |
| 8 | 8 | with a ``home`` key pointing to the Python installation from which the command | |
| 9 | - was run. It also creates a ``bin`` (or ``Scripts`` on Windows) subdirectory | ||
| 10 | - containing a copy/symlink of the Python binary/binaries (as appropriate for the | ||
| 11 | - platform or arguments used at environment creation time). It also creates an | ||
| 12 | - (initially empty) ``lib/pythonX.Y/site-packages`` subdirectory | ||
| 13 | - (on Windows, this is ``Lib\site-packages``). If an existing | ||
| 14 | - directory is specified, it will be re-used. | ||
| 9 | + was run (a common name for the target directory is ``.venv``). It also creates | ||
| 10 | + a ``bin`` (or ``Scripts`` on Windows) subdirectory containing a copy/symlink | ||
| 11 | + of the Python binary/binaries (as appropriate for the platform or arguments | ||
| 12 | + used at environment creation time). It also creates an (initially empty) | ||
| 13 | + ``lib/pythonX.Y/site-packages`` subdirectory (on Windows, this is | ||
| 14 | + ``Lib\site-packages``). If an existing directory is specified, it will be | ||
| 15 | + re-used. | ||
| 15 | 16 | ||
| 16 | 17 | .. deprecated:: 3.6 | |
| 17 | 18 | ``pyvenv`` was the recommended tool for creating virtual environments for | |
@@ -101,12 +102,14 @@ directory containing the virtual environment): | |||
| 101 | 102 | +-------------+-----------------+-----------------------------------------+ | |
| 102 | 103 | | Platform | Shell | Command to activate virtual environment | | |
| 103 | 104 | +=============+=================+=========================================+ | |
| 104 | - | Posix | bash/zsh | $ source <venv>/bin/activate | | ||
| 105 | + | POSIX | bash/zsh | $ source <venv>/bin/activate | | ||
| 105 | 106 | +-------------+-----------------+-----------------------------------------+ | |
| 106 | 107 | | | fish | $ . <venv>/bin/activate.fish | | |
| 107 | 108 | +-------------+-----------------+-----------------------------------------+ | |
| 108 | 109 | | | csh/tcsh | $ source <venv>/bin/activate.csh | | |
| 109 | 110 | +-------------+-----------------+-----------------------------------------+ | |
| 111 | + | | PowerShell Core | $ <venv>/bin/Activate.ps1 | | ||
| 112 | + +-------------+-----------------+-----------------------------------------+ | ||
| 110 | 113 | | Windows | cmd.exe | C:\\> <venv>\\Scripts\\activate.bat | | |
| 111 | 114 | +-------------+-----------------+-----------------------------------------+ | |
| 112 | 115 | | | PowerShell | PS C:\\> <venv>\\Scripts\\Activate.ps1 | | |
@@ -127,3 +130,7 @@ when the virtual environment is created. | |||
| 127 | 130 | ||
| 128 | 131 | .. versionadded:: 3.4 | |
| 129 | 132 | ``fish`` and ``csh`` activation scripts. | |
| 133 | + | ||
| 134 | + .. versionadded:: 3.8 | ||
| 135 | + PowerShell activation scripts installed under POSIX for PowerShell Core | ||
| 136 | + support. | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments