Skip to content

Commit dc14e33

Browse files
authored
bpo-22295: use python -m pip rather than plain pip in more examples (GH-24003)
1 parent f52d987 commit dc14e33

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

Doc/library/importlib.metadata.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ something into it:
4343
4444
$ python3 -m venv example
4545
$ source example/bin/activate
46-
(example) $ pip install wheel
46+
(example) $ python -m pip install wheel
4747
4848
You can get the version string for ``wheel`` by running the following:
4949

Doc/library/itertools.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ Substantially all of these recipes and many, many others can be installed from
721721
the `more-itertools project <https://pypi.org/project/more-itertools/>`_ found
722722
on the Python Package Index::
723723

724-
pip install more-itertools
724+
python -m pip install more-itertools
725725

726726
The extended tools offer the same high performance as the underlying toolset.
727727
The superior memory performance is kept by processing elements one at a time

Doc/tutorial/venv.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ package name followed by ``==`` and the version number:
130130
131131
If you re-run this command, ``pip`` will notice that the requested
132132
version is already installed and do nothing. You can supply a
133-
different version number to get that version, or you can run ``pip
134-
install --upgrade`` to upgrade the package to the latest version:
133+
different version number to get that version, or you can run ``python
134+
-m pip install --upgrade`` to upgrade the package to the latest version:
135135

136136
.. code-block:: bash
137137
@@ -143,14 +143,14 @@ install --upgrade`` to upgrade the package to the latest version:
143143
Successfully uninstalled requests-2.6.0
144144
Successfully installed requests-2.7.0
145145
146-
``pip uninstall`` followed by one or more package names will remove the
147-
packages from the virtual environment.
146+
``python -m pip uninstall`` followed by one or more package names will
147+
remove the packages from the virtual environment.
148148

149-
``pip show`` will display information about a particular package:
149+
``python -m pip show`` will display information about a particular package:
150150

151151
.. code-block:: bash
152152
153-
(tutorial-env) $ pip show requests
153+
(tutorial-env) $ python -m pip show requests
154154
---
155155
Metadata-Version: 2.0
156156
Name: requests
@@ -163,25 +163,25 @@ packages from the virtual environment.
163163
Location: /Users/akuchling/envs/tutorial-env/lib/python3.4/site-packages
164164
Requires:
165165
166-
``pip list`` will display all of the packages installed in the virtual
167-
environment:
166+
``python -m pip list`` will display all of the packages installed in
167+
the virtual environment:
168168

169169
.. code-block:: bash
170170
171-
(tutorial-env) $ pip list
171+
(tutorial-env) $ python -m pip list
172172
novas (3.1.1.3)
173173
numpy (1.9.2)
174174
pip (7.0.3)
175175
requests (2.7.0)
176176
setuptools (16.0)
177177
178-
``pip freeze`` will produce a similar list of the installed packages,
179-
but the output uses the format that ``pip install`` expects.
178+
``python -m pip freeze`` will produce a similar list of the installed packages,
179+
but the output uses the format that ``python -m pip install`` expects.
180180
A common convention is to put this list in a ``requirements.txt`` file:
181181

182182
.. code-block:: bash
183183
184-
(tutorial-env) $ pip freeze > requirements.txt
184+
(tutorial-env) $ python -m pip freeze > requirements.txt
185185
(tutorial-env) $ cat requirements.txt
186186
novas==3.1.1.3
187187
numpy==1.9.2

0 commit comments

Comments
 (0)