@@ -10,16 +10,72 @@ Do I need to install pip?
10
10
pip is already installed if you are using Python 2 >=2.7.9 or Python 3 >=3.4
11
11
downloaded from `python.org <https://www.python.org >`_ or if you are working
12
12
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).
15
65
16
66
17
67
.. _`get-pip` :
18
68
19
69
Installing with get-pip.py
20
70
==========================
21
71
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
23
79
this link: `get-pip.py
24
80
<https://bootstrap.pypa.io/get-pip.py> `_. Alternatively, use ``curl ``::
25
81
@@ -40,13 +96,6 @@ have downloaded ``get-pip.py``:
40
96
41
97
py get-pip.py
42
98
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
-
50
99
``get-pip.py `` also installs :ref: `pypug:setuptools ` [2 ]_ and :ref: `pypug:wheel `
51
100
if they are not already. :ref: `pypug:setuptools ` is required to install
52
101
:term: `source distributions <pypug:Source Distribution (or "sdist")> `. Both are
@@ -134,13 +183,6 @@ Install behind a proxy:
134
183
135
184
py get-pip.py pip==9.0.2 wheel==0.30.0 setuptools==28.8.0
136
185
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
-
144
186
.. _`Upgrading pip` :
145
187
146
188
Upgrading pip
0 commit comments