Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4a4b679

Browse files
committed
Merge issue #22295 fix from 3.4
2 parents e0047cc + 1d52096 commit 4a4b679

3 files changed

Lines changed: 39 additions & 12 deletions

File tree

Doc/distributing/index.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,18 @@ is important to have standard tools that work consistently, even on older
9393
versions of Python.
9494

9595
The currently recommended build and distribution tools can be installed
96-
using ``pip``::
96+
by invoking the ``pip`` module at the command line::
9797

98-
pip install setuptools wheel twine
98+
python -m pip install setuptools wheel twine
99+
100+
.. note::
101+
102+
For POSIX users (including Mac OS X and Linux users), these instructions
103+
assume the use of a :term:`virtual environment`.
104+
105+
For Windows users, these instructions assume that the option to
106+
adjust the system PATH environment variable was selected when installing
107+
Python.
99108

100109
The Python Packaging User Guide includes more details on the `currently
101110
recommended tools`_.

Doc/glossary.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,14 @@ Glossary
858858
dictionary view to become a full list use ``list(dictview)``. See
859859
:ref:`dict-views`.
860860

861+
virtual environment
862+
A cooperatively isolated runtime environment that allows Python users
863+
and applications to install and upgrade Python distribution packages
864+
without interfering with the behaviour of other Python applications
865+
running on the same system.
866+
867+
See also :ref:`scripts-pyvenv`
868+
861869
virtual machine
862870
A computer defined entirely in software. Python's virtual machine
863871
executes the :term:`bytecode` emitted by the bytecode compiler.

Doc/installing/index.rst

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ Key terms
4040
* ``pyvenv`` is the standard tool for creating virtual environments, and has
4141
been part of Python since Python 3.3. Starting with Python 3.4, it
4242
defaults to installing ``pip`` into all created virtual environments
43+
* ``virtualenv`` is a third party alternative (and predecessor) to
44+
``pyvenv``. It allows virtual environments to be used on versions of
45+
Python prior to 3.4, which either don't provide ``pyvenv`` at all, or
46+
aren't able to automatically install ``pip`` into created environments.
4347
* the `Python Package Index <https://pypi.python.org/pypi>`__ is a public
4448
repository of open source licensed packages made available for use by
4549
other Python users
@@ -63,27 +67,33 @@ Basic usage
6367
===========
6468

6569
The standard packaging tools are all designed to be used from the command
66-
line. For Windows users, the examples below assume that the option to
67-
adjust the system PATH environment variable was selected when installing
68-
Python. For Linux users, the command to install into the system version of
69-
Python 3 is likely to be ``pip3`` rather than ``pip``.
70+
line.
7071

7172
The following command will install the latest version of a module and its
7273
dependencies from the Python Package Index::
7374

74-
pip install SomePackage
75+
python -m pip install SomePackage
76+
77+
.. note::
78+
79+
For POSIX users (including Mac OS X and Linux users), the examples in
80+
this guide assume the use of a :term:`virtual environment`.
81+
82+
For Windows users, the examples in this guide assume that the option to
83+
adjust the system PATH environment variable was selected when installing
84+
Python.
7585

7686
It's also possible to specify an exact or minimum version directly on the
7787
command line::
7888

79-
pip install SomePackage==1.0.4 # specific version
80-
pip install 'SomePackage>=1.0.4' # minimum version
89+
python -m pip install SomePackage==1.0.4 # specific version
90+
python -m pip install 'SomePackage>=1.0.4' # minimum version
8191

8292
Normally, if a suitable module is already installed, attempting to install
8393
it again will have no effect. Upgrading existing modules must be requested
8494
explicitly::
8595

86-
pip install --upgrade SomePackage
96+
python -m pip install --upgrade SomePackage
8797

8898
More information and resources regarding ``pip`` and its capabilities can be
8999
found in the `Python Packaging User Guide <http://packaging.python.org>`__.
@@ -120,8 +130,8 @@ User Guide.
120130
... install packages just for the current user?
121131
-----------------------------------------------
122132

123-
Passing the ``--user`` option to ``pip install`` will install a package
124-
just for the current user, rather than for all users of the system.
133+
Passing the ``--user`` option to ``python -m pip install`` will install a
134+
package just for the current user, rather than for all users of the system.
125135

126136

127137
... install scientific Python packages?

0 commit comments

Comments
 (0)