@@ -23,7 +23,7 @@ The guide covers how to:
2323
2424.. important ::
2525 This guide has the prerequisite that you are using an official Python version obtained from
26- <https://www.python.org/downloads/> is installed . If you are using your operating
26+ <https://www.python.org/downloads/>. If you are using your operating
2727 system's package manager to install Python, please ensure that Python is
2828 installed before proceeding with these steps.
2929
@@ -46,7 +46,7 @@ another project's environment.
4646 party packages.
4747
4848To create a virtual environment, go to your project's directory and run
49- ``venv ``.
49+ ``venv ``. This will create a new virtual environment in a local folder `` .venv ``:
5050
5151.. tab :: Unix/macOS
5252
@@ -87,7 +87,7 @@ shell's ``PATH``.
8787
8888 .. code-block :: bat
8989
90- .\. venv\Scripts\activate
90+ .venv\bin\Activate.bat
9191
9292 To confirm the virtual environment is activated, check the location of your
9393Python interpreter:
@@ -117,7 +117,7 @@ the ``.venv`` directory:
117117
118118 .. code-block :: bat
119119
120- ...\.venv\Scripts \python.exe
120+ ...\.venv\bin \python.exe
121121
122122
123123 While a virtual environment is activated, pip will install packages into that
@@ -135,6 +135,10 @@ If you want to switch projects or leave your virtual environment,
135135
136136 deactivate
137137
138+ .. note ::
139+ Closing your shell will deactivate the virtual environment. If
140+ you open a new shell window and want to use the virtual environment,
141+ reactivate it.
138142
139143Reactivate a virtual environment
140144~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -153,26 +157,19 @@ It's used to install and update packages into a virtual environment.
153157
154158.. tab :: Unix
155159
156- Debian and most other distributions include a `python-pip `_ package; if you
157- want to use the Linux distribution-provided versions of pip, see
158- :doc: `/guides/installing-using-linux-tools `.
159-
160- You can also install pip yourself to ensure you have the latest version. It's
161- recommended to use the system pip to bootstrap a user installation of pip:
160+ You can make sure that pip is up-to-date by running:
162161
163162 .. code-block :: bash
164163
165- python3 -m pip install --user -- upgrade pip
164+ python3 -m pip install --upgrade pip
166165 python3 -m pip --version
167166
168167 Afterwards, you should have the latest version of pip installed in your
169168 user site:
170169
171170 .. code-block :: text
172171
173- pip 21.1.3 from $HOME/.local/lib/python3.9/site-packages (python 3.9)
174-
175- .. _python-pip : https://packages.debian.org/stable/python/python3-pip
172+ pip 21.1.3 from ../.venv/lib/python3.9/site-packages (python 3.9)
176173
177174 .. tab :: macOS
178175
@@ -189,9 +186,7 @@ It's used to install and update packages into a virtual environment.
189186
190187 .. code-block :: text
191188
192- pip 21.1.3 from $HOME/.local/lib/python3.9/site-packages (python 3.9)
193-
194- .. _python-pip : https://packages.debian.org/stable/python/python3-pip
189+ pip 23.3.1 from $HOME/.venv/lib/python3.9/site-packages (python 3.9)
195190
196191 .. tab :: Windows
197192
@@ -207,7 +202,7 @@ It's used to install and update packages into a virtual environment.
207202
208203 .. code-block :: text
209204
210- pip 21.1.3 from c:\python39 \lib\site-packages (Python 3.9.4)
205+ pip 23.3.1 from .venv \lib\site-packages (Python 3.9.4)
211206
212207
213208 Install packages using pip
0 commit comments