|
| 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. |
0 commit comments