|
1 |
| -.. _`Installation`: |
| 1 | +:orphan: |
2 | 2 |
|
3 |
| -============ |
4 |
| -Installation |
5 |
| -============ |
| 3 | +.. meta:: |
6 | 4 |
|
7 |
| -Do I need to install pip? |
8 |
| -========================= |
| 5 | + :http-equiv=refresh: 3; url=../installation/ |
9 | 6 |
|
10 |
| -pip is already installed if you are using Python 2 >=2.7.9 or Python 3 >=3.4 |
11 |
| -downloaded from `python.org <https://www.python.org>`_ or if you are working |
12 |
| -in a :ref:`Virtual Environment <pypug:Creating and using Virtual Environments>` |
13 |
| -created by :ref:`pypug:virtualenv` or :ref:`venv <pypug:venv>`. Just make sure |
14 |
| -to :ref:`upgrade pip <Upgrading pip>`. |
| 7 | +This page has moved |
| 8 | +=================== |
15 | 9 |
|
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). |
65 |
| - |
66 |
| - |
67 |
| -.. _`get-pip`: |
68 |
| - |
69 |
| -Installing with get-pip.py |
70 |
| -========================== |
71 |
| - |
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 |
79 |
| -this link: `get-pip.py |
80 |
| -<https://bootstrap.pypa.io/get-pip.py>`_. Alternatively, use ``curl``:: |
81 |
| - |
82 |
| - curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py |
83 |
| - |
84 |
| -Then run the following command in the folder where you |
85 |
| -have downloaded ``get-pip.py``: |
86 |
| - |
87 |
| -.. tab:: Unix/macOS |
88 |
| - |
89 |
| - .. code-block:: shell |
90 |
| -
|
91 |
| - python get-pip.py |
92 |
| -
|
93 |
| -.. tab:: Windows |
94 |
| - |
95 |
| - .. code-block:: shell |
96 |
| -
|
97 |
| - py get-pip.py |
98 |
| -
|
99 |
| -``get-pip.py`` also installs :ref:`pypug:setuptools` [2]_ and :ref:`pypug:wheel` |
100 |
| -if they are not already. :ref:`pypug:setuptools` is required to install |
101 |
| -:term:`source distributions <pypug:Source Distribution (or "sdist")>`. Both are |
102 |
| -required in order to build a :ref:`Wheel cache` (which improves installation |
103 |
| -speed), although neither are required to install pre-built :term:`wheels |
104 |
| -<pypug:Wheel>`. |
105 |
| - |
106 |
| -.. note:: |
107 |
| - |
108 |
| - The get-pip.py script is supported on the same python version as pip. |
109 |
| - For the now unsupported Python 2.6, alternate script is available |
110 |
| - `here <https://bootstrap.pypa.io/2.6/get-pip.py>`__. |
111 |
| - |
112 |
| - |
113 |
| -get-pip.py options |
114 |
| ------------------- |
115 |
| - |
116 |
| -.. option:: --no-setuptools |
117 |
| - |
118 |
| - If set, do not attempt to install :ref:`pypug:setuptools` |
119 |
| - |
120 |
| -.. option:: --no-wheel |
121 |
| - |
122 |
| - If set, do not attempt to install :ref:`pypug:wheel` |
123 |
| - |
124 |
| - |
125 |
| -``get-pip.py`` allows :ref:`pip install options <pip |
126 |
| -install Options>` and the :ref:`general options <General Options>`. Below are |
127 |
| -some examples: |
128 |
| - |
129 |
| -Install from local copies of pip and setuptools: |
130 |
| - |
131 |
| -.. tab:: Unix/macOS |
132 |
| - |
133 |
| - .. code-block:: shell |
134 |
| -
|
135 |
| - python get-pip.py --no-index --find-links=/local/copies |
136 |
| -
|
137 |
| -.. tab:: Windows |
138 |
| - |
139 |
| - .. code-block:: shell |
140 |
| -
|
141 |
| - py get-pip.py --no-index --find-links=/local/copies |
142 |
| -
|
143 |
| -Install to the user site [3]_: |
144 |
| - |
145 |
| -.. tab:: Unix/macOS |
146 |
| - |
147 |
| - .. code-block:: shell |
148 |
| -
|
149 |
| - python get-pip.py --user |
150 |
| -
|
151 |
| -.. tab:: Windows |
152 |
| - |
153 |
| - .. code-block:: shell |
154 |
| -
|
155 |
| - py get-pip.py --user |
156 |
| -
|
157 |
| -Install behind a proxy: |
158 |
| - |
159 |
| -.. tab:: Unix/macOS |
160 |
| - |
161 |
| - .. code-block:: shell |
162 |
| -
|
163 |
| - python get-pip.py --proxy="http://[user:passwd@]proxy.server:port" |
164 |
| -
|
165 |
| -.. tab:: Windows |
166 |
| - |
167 |
| - .. code-block:: shell |
168 |
| -
|
169 |
| - py get-pip.py --proxy="http://[user:passwd@]proxy.server:port" |
170 |
| -
|
171 |
| -``get-pip.py`` can also be used to install a specified combination of ``pip``, |
172 |
| -``setuptools``, and ``wheel`` using the same requirements syntax as pip: |
173 |
| - |
174 |
| -.. tab:: Unix/macOS |
175 |
| - |
176 |
| - .. code-block:: shell |
177 |
| -
|
178 |
| - python get-pip.py pip==9.0.2 wheel==0.30.0 setuptools==28.8.0 |
179 |
| -
|
180 |
| -.. tab:: Windows |
181 |
| - |
182 |
| - .. code-block:: shell |
183 |
| -
|
184 |
| - py get-pip.py pip==9.0.2 wheel==0.30.0 setuptools==28.8.0 |
185 |
| -
|
186 |
| -.. _`Upgrading pip`: |
187 |
| - |
188 |
| -Upgrading pip |
189 |
| -============= |
190 |
| - |
191 |
| -.. tab:: Unix/macOS |
192 |
| - |
193 |
| - .. code-block:: shell |
194 |
| -
|
195 |
| - python -m pip install -U pip |
196 |
| -
|
197 |
| -.. tab:: Windows |
198 |
| - |
199 |
| - .. code-block:: shell |
200 |
| -
|
201 |
| - py -m pip install -U pip |
202 |
| -
|
203 |
| -
|
204 |
| -.. _compatibility-requirements: |
205 |
| - |
206 |
| -Python and OS Compatibility |
207 |
| -=========================== |
208 |
| - |
209 |
| -pip works with CPython versions 3.6, 3.7, 3.8, 3.9 and also PyPy. |
210 |
| - |
211 |
| -This means pip works on the latest patch version of each of these minor |
212 |
| -versions. Previous patch versions are supported on a best effort approach. |
213 |
| - |
214 |
| -pip works on Unix/Linux, macOS, and Windows. |
215 |
| - |
216 |
| - |
217 |
| ----- |
218 |
| - |
219 |
| -.. [1] "Secure" in this context means using a modern browser or a |
220 |
| - tool like ``curl`` that verifies SSL certificates when downloading from |
221 |
| - https URLs. |
222 |
| -
|
223 |
| -.. [2] Beginning with pip v1.5.1, ``get-pip.py`` stopped requiring setuptools to |
224 |
| - be installed first. |
225 |
| -
|
226 |
| -.. [3] The pip developers are considering making ``--user`` the default for all |
227 |
| - installs, including ``get-pip.py`` installs of pip, but at this time, |
228 |
| - ``--user`` installs for pip itself, should not be considered to be fully |
229 |
| - tested or endorsed. For discussion, see `Issue 1668 |
230 |
| - <https://github.com/pypa/pip/issues/1668>`_. |
| 10 | +You should be redirected automatically in 3 seconds. If that didn't |
| 11 | +work, here's a link: :doc:`installation` |
0 commit comments