Skip to content

Commit f89a0c9

Browse files
committed
tool install instructions for linux pkg mgrs
1 parent f19908d commit f89a0c9

3 files changed

Lines changed: 159 additions & 25 deletions

File tree

‎source/additional.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ either of our guides on :doc:`installing` or :doc:`distributing`.
1111
.. toctree::
1212
:maxdepth: 1
1313

14+
install_requirements_linux
1415
extensions
1516
multiple_python_versions
1617
patching
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
2+
.. _`Installing pip/setuptools/wheel with Linux Package Managers`:
3+
4+
===========================================================
5+
Installing pip/setuptools/wheel with Linux Package Managers
6+
===========================================================
7+
8+
:Page Status: Incomplete
9+
:Last Reviewed: 2015-09-17
10+
11+
12+
This section covers how to install :ref:`pip`, :ref:`setuptools`, and
13+
:ref:`wheel` using Linux package managers.
14+
15+
If you're using a Python that was downloaded from `python.org
16+
<https://www.python.org>`_, then this section does not apply. See the
17+
:ref:`installing_requirements` section instead.
18+
19+
Note that it's common for the versions of :ref:`pip`, :ref:`setuptools`, and
20+
:ref:`wheel` supported by a specific Linux Distribution to be outdated by the
21+
time it's released to the public, and updates generally only occur for security
22+
reasons, not for feature updates. For certain Distributions, there are
23+
additional repositories that can be enabled to provide newer versions. The
24+
repositories we know about are explained below.
25+
26+
Also note that it's somewhat common for Distributions to apply patches for the
27+
sake of security and normalization to their own standards. In some cases, this
28+
can lead to bugs or unexpected behaviors that vary from the original unpatched
29+
versions. When this is known, we will make note of it below.
30+
31+
32+
Fedora
33+
~~~~~~
34+
35+
* < Fedora 22:
36+
37+
* ``sudo yum install python-pip`` (use "python3-pip" for Python 3)
38+
* setuptools is already installed
39+
* wheel is not available
40+
41+
* >= Fedora 22:
42+
43+
pip and setuptools are already installed. wheel is not available.
44+
45+
To get newer versions of pip (and also setuptools and wheel), you can enable the
46+
`PyPA Copr Repo <https://copr.fedoraproject.org/coprs/pypa/pypa/>`_ using the
47+
`Copr Repo instructions <https://fedorahosted.org/copr/wiki/HowToEnableRepo>`__,
48+
and run the following:
49+
50+
* < Fedora 23:
51+
52+
::
53+
54+
sudo yum install python-pip python-setuptools python-wheel
55+
56+
Replace "python" with "python3" for Python 3.
57+
58+
* >= Fedora 23: same as above, but use "dnf", instead of "yum"
59+
60+
61+
CentOS/RHEL
62+
~~~~~~~~~~~
63+
64+
CentOS and RHEL don't offer :ref:`pip` or :ref:`wheel` in their core repositories,
65+
although :ref:`setuptools` is installed by default.
66+
67+
There's three options available to fill in :ref:`pip` and :ref:`wheel`, and to
68+
upgrade :ref:`setuptools`:
69+
70+
1. Use the "Sofware Collections" feature to enable a collection that includes
71+
pip, setuptools, and wheel.
72+
73+
* For Redhat, see here:
74+
http://developers.redhat.com/products/softwarecollections/overview/
75+
* For CentOS, see here: https://www.softwarecollections.org/en/
76+
77+
Although this has promise to be the preferred method in the future, as it is,
78+
you can't count on finding a collection that has recent versions.
79+
80+
2. You can install pip from the `EPEL repository
81+
<https://fedoraproject.org/wiki/EPEL>`_. Enable EPEL using `these
82+
instructions
83+
<https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F>`__,
84+
and install like so::
85+
86+
sudo yum install python-pip
87+
88+
Although EPEL tends to maintain a pretty recent version of :ref:`pip`, it
89+
does not maintain :ref:`setuptools` or :ref:`wheel`, so you'd have to settle
90+
for the distro version of setuptools, and use pip itself to install
91+
wheel.
92+
93+
3. You can enable the `PyPA Copr Repo
94+
<https://copr.fedoraproject.org/coprs/pypa/pypa/>`_ using `these instructions
95+
<https://fedorahosted.org/copr/wiki/HowToEnableRepo>`__ [1]_, and run::
96+
97+
sudo yum install python-pip python-setuptools python-wheel
98+
99+
100+
Also, note that if you're using the `IUS repository
101+
<https://iuscommunity.org/pages/Repos.html>`_ to install alternative Python
102+
versions, IUS also maintains corresponding versions versions of pip, setuptools,
103+
and wheel that are usually up to date.
104+
105+
106+
Debian/Ubuntu
107+
~~~~~~~~~~~~~
108+
109+
::
110+
111+
sudo apt-get install python-pip
112+
113+
Replace "python" with "python3" for Python 3.
114+
115+
116+
.. warning::
117+
118+
Recent Debian/Ubuntu versions have modified pip to use the `"User Scheme"
119+
<https://pip.pypa.io/en/stable/user_guide/#user-installs>`_ by default, which
120+
is a significant behavior change that can be surprising to some users.
121+
122+
123+
----
124+
125+
.. [1] Currently, there is no "copr" yum plugin available for CentOS/RHEL, so
126+
the only option is to manually place the repo files as described.

‎source/installing.rst‎

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,48 +30,55 @@ Requirements for Installing Packages
3030
This section describes the steps to follow before installing other Python
3131
packages.
3232

33-
1. Install :ref:`pip`, :ref:`setuptools`, and :ref:`wheel`:
33+
Install pip, setuptools, and wheel
34+
----------------------------------
3435

35-
If you have Python 2 >=2.7.9 or Python 3 >=3.4 installed from `python.org
36-
<https://www.python.org>`_:
36+
* If you have Python 2 >=2.7.9 or Python 3 >=3.4 installed from `python.org
37+
<https://www.python.org>`_, you will already have :ref:`pip` and
38+
:ref:`setuptools`, but will need to upgrade to the latest version:
3739

38-
You will already have :ref:`pip` and :ref:`setuptools`, but will need to
39-
upgrade to the latest version:
40+
On Linux or OS X:
4041

41-
On Linux or OS X:
42+
::
4243

43-
::
44+
pip install -U pip
4445

45-
pip install -U pip
4646

47+
On Windows:
4748

48-
On Windows:
49+
::
4950

50-
::
51+
python -m pip install -U pip
5152

52-
python -m pip install -U pip
53+
You will not have :ref:`wheel`, so you'll need to run: ``pip install wheel``
5354

54-
You will not have :ref:`wheel`, so you'll need to run: ``pip install wheel``
55+
* If you're using a Python install on Linux that's managed by the system package
56+
manager (e.g "yum", "apt-get" etc...), and you want to use the system package
57+
manager to install or upgrade pip, then see :ref:`Installing
58+
pip/setuptools/wheel with Linux Package Managers`
5559

56-
Otherwise:
60+
* Otherwise:
5761

58-
* Securely Download `get-pip.py
59-
<https://raw.github.com/pypa/pip/master/contrib/get-pip.py>`_ [1]_
62+
* Securely Download `get-pip.py
63+
<https://raw.github.com/pypa/pip/master/contrib/get-pip.py>`_ [1]_
6064

61-
* Run ``python get-pip.py``. [2]_ This will install or upgrade pip.
62-
Additionally, it will install :ref:`setuptools` and :ref:`wheel` if they're
63-
not installed already.
65+
* Run ``python get-pip.py``. [2]_ This will install or upgrade pip.
66+
Additionally, it will install :ref:`setuptools` and :ref:`wheel` if they're
67+
not installed already.
6468

65-
.. warning::
69+
.. warning::
6670

67-
Be cautious if you're using a Python install that's managed by your
68-
operating system or another package manager. get-pip.py does not
69-
coordinate with those tools, and may leave your system in an
70-
inconsistent state.
71+
Be cautious if you're using a Python install that's managed by your
72+
operating system or another package manager. get-pip.py does not
73+
coordinate with those tools, and may leave your system in an
74+
inconsistent state.
7175

7276

73-
2. Optionally, Create a virtual environment (See :ref:`section below <Creating
74-
and using Virtual Environments>` for details):
77+
Optionally, Create a virtual environment
78+
----------------------------------------
79+
80+
See :ref:`section below <Creating and using Virtual Environments>` for details,
81+
but here's the basic commands:
7582

7683
Using :ref:`virtualenv`:
7784

0 commit comments

Comments
 (0)