Skip to content

Commit 3f21049

Browse files
committed
Reorder and revise installation docs
An additional section is added to instruct the user to self-check whether pip is installed before proceeding. The Linux package manager section is moved to the front to encourage users to try that first before learning about get-pip.py, which tends to provide seemingly working but subtly broken results there. A paragraph is added to the section to instruct users to report issues to package managers instead. A new section on enturepip is added as an alternative to get-pip.py, which is almost guarenteed to be available at this point.
1 parent a88c84d commit 3f21049

File tree

2 files changed

+61
-17
lines changed

2 files changed

+61
-17
lines changed

docs/html/installing.rst

Lines changed: 59 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,72 @@ Do I need to install pip?
1010
pip is already installed if you are using Python 2 >=2.7.9 or Python 3 >=3.4
1111
downloaded from `python.org <https://www.python.org>`_ or if you are working
1212
in a :ref:`Virtual Environment <pypug:Creating and using Virtual Environments>`
13-
created by :ref:`pypug:virtualenv` or :ref:`pyvenv <pypug:venv>`.
14-
Just make sure to :ref:`upgrade pip <Upgrading pip>`.
13+
created by :ref:`pypug:virtualenv` or :ref:`venv <pypug:venv>`. Just make sure
14+
to :ref:`upgrade pip <Upgrading pip>`.
15+
16+
Use the following command to check whether pip is installed:
17+
18+
.. tab:: Unix/macOS
19+
20+
.. code-block:: console
21+
22+
$ python -m pip --version
23+
pip X.Y.Z from .../site-packages/pip (python X.Y)
24+
25+
.. tab:: Windows
26+
27+
.. code-block:: console
28+
29+
C:\> py -m pip --version
30+
pip X.Y.Z from ...\site-packages\pip (python X.Y)
31+
32+
Using Linux Package Managers
33+
============================
34+
35+
.. warning::
36+
37+
If you installed Python from a package manager on Linux, you should always
38+
install pip for that Python installation using the same source.
39+
40+
See `pypug:Installing pip/setuptools/wheel with Linux Package Managers <https://packaging.python.org/guides/installing-using-linux-tools/>`_
41+
in the Python Packaging User Guide.
42+
43+
Here are ways to contact a few Linux package maintainers if you run into
44+
problems:
45+
46+
* `Deadsnakes PPA <https://github.com/deadsnakes/issues>`_
47+
* `Debian Python Team <https://wiki.debian.org/Teams/PythonTeam>`_ (for general
48+
issues related to ``apt``)
49+
* `Red Hat Bugzilla <https://bugzilla.redhat.com/>`_
50+
51+
pip developers do not have control over how Linux distributions handle pip
52+
installations, and are unable to provide solutions to related issues in
53+
general.
54+
55+
Using ensurepip
56+
===============
57+
58+
Python >=3.4 can self-bootstrap pip with the built-in
59+
:ref:`ensurepip <pypug:ensurepip>` module. Refer to the standard library
60+
documentation for more details. Make sure to :ref:`upgrade pip <Upgrading pip>`
61+
after ``ensurepip`` installs pip.
62+
63+
See the `Using Linux Package Managers`_ section if your Python reports
64+
``No module named ensurepip`` on Debian and derived systems (e.g. Ubuntu).
1565

1666

1767
.. _`get-pip`:
1868

1969
Installing with get-pip.py
2070
==========================
2171

22-
To install pip, securely [1]_ download ``get-pip.py`` by following
72+
.. warning::
73+
74+
Be cautious if you are using a Python install that is managed by your operating
75+
system or another package manager. ``get-pip.py`` does not coordinate with
76+
those tools, and may leave your system in an inconsistent state.
77+
78+
To manually install pip, securely [1]_ download ``get-pip.py`` by following
2379
this link: `get-pip.py
2480
<https://bootstrap.pypa.io/get-pip.py>`_. Alternatively, use ``curl``::
2581

@@ -40,13 +96,6 @@ have downloaded ``get-pip.py``:
4096
4197
py get-pip.py
4298
43-
44-
.. warning::
45-
46-
Be cautious if you are using a Python install that is managed by your operating
47-
system or another package manager. ``get-pip.py`` does not coordinate with
48-
those tools, and may leave your system in an inconsistent state.
49-
5099
``get-pip.py`` also installs :ref:`pypug:setuptools` [2]_ and :ref:`pypug:wheel`
51100
if they are not already. :ref:`pypug:setuptools` is required to install
52101
:term:`source distributions <pypug:Source Distribution (or "sdist")>`. Both are
@@ -134,13 +183,6 @@ Install behind a proxy:
134183
135184
py get-pip.py pip==9.0.2 wheel==0.30.0 setuptools==28.8.0
136185
137-
Using Linux Package Managers
138-
============================
139-
140-
See :ref:`pypug:Installing pip/setuptools/wheel with Linux Package Managers` in
141-
the `Python Packaging User Guide
142-
<https://packaging.python.org/guides/tool-recommendations/>`_.
143-
144186
.. _`Upgrading pip`:
145187

146188
Upgrading pip

news/9131.doc.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Reorder and revise installation instructions to make them easier to follow.
2+

0 commit comments

Comments
 (0)