|
| 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 21: |
| 36 | + |
| 37 | + * Python 2:: |
| 38 | + |
| 39 | + sudo yum upgrade python-setuptools |
| 40 | + sudo yum install python-pip python-wheel |
| 41 | + |
| 42 | + * Python 3: ``sudo yum install python3 python3-wheel`` |
| 43 | + |
| 44 | +* Fedora 22: |
| 45 | + |
| 46 | + * Python 2:: |
| 47 | + |
| 48 | + sudo dnf upgrade python-setuptools |
| 49 | + sudo dnf install python-pip python-wheel |
| 50 | + |
| 51 | + * Python 3: ``sudo dnf install python3 python3-wheel`` |
| 52 | + |
| 53 | + |
| 54 | +To get newer versions of pip, setuptools, and wheel for Python 2, you can enable |
| 55 | +the `PyPA Copr Repo <https://copr.fedoraproject.org/coprs/pypa/pypa/>`_ using |
| 56 | +the `Copr Repo instructions |
| 57 | +<https://fedorahosted.org/copr/wiki/HowToEnableRepo>`__, and then run:: |
| 58 | + |
| 59 | + sudo yum|dnf upgrade python-setuptools |
| 60 | + sudo yum|dnf install python-pip python-wheel |
| 61 | + |
| 62 | + |
| 63 | +CentOS/RHEL |
| 64 | +~~~~~~~~~~~ |
| 65 | + |
| 66 | +CentOS and RHEL don't offer :ref:`pip` or :ref:`wheel` in their core repositories, |
| 67 | +although :ref:`setuptools` is installed by default. |
| 68 | + |
| 69 | +To install pip and wheel for the system Python, there are two options: |
| 70 | + |
| 71 | +1. Enable the `EPEL repository <https://fedoraproject.org/wiki/EPEL>`_ using |
| 72 | + `these instructions |
| 73 | + <https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F>`__. On |
| 74 | + EPEL 6 and EPEL7, you can install pip like so:: |
| 75 | + |
| 76 | + sudo yum install python-pip |
| 77 | + |
| 78 | + On EPEL 7 (but not EPEL 6), you can install wheel like so:: |
| 79 | + |
| 80 | + sudo yum install python-wheel |
| 81 | + |
| 82 | + Since EPEL only offers extra, non-conflicting packages, EPEL does not offer |
| 83 | + setuptools, since it's in the core repository. |
| 84 | + |
| 85 | + |
| 86 | +2. Enable the `PyPA Copr Repo |
| 87 | + <https://copr.fedoraproject.org/coprs/pypa/pypa/>`_ using `these instructions |
| 88 | + <https://fedorahosted.org/copr/wiki/HowToEnableRepo>`__ [1]_. You can install |
| 89 | + pip and wheel like so:: |
| 90 | + |
| 91 | + sudo yum install python-pip python-wheel |
| 92 | + |
| 93 | + To additionally upgrade setuptools, run:: |
| 94 | + |
| 95 | + sudo yum upgrade python-setuptools |
| 96 | + |
| 97 | + |
| 98 | +To install pip, wheel, and setuptools, in a parallel, non-system environment |
| 99 | +(using yum) then there are two options: |
| 100 | + |
| 101 | + |
| 102 | +1. Use the "Sofware Collections" feature to enable a parallel collection that |
| 103 | + includes pip, setuptools, and wheel. |
| 104 | + |
| 105 | + * For Redhat, see here: |
| 106 | + http://developers.redhat.com/products/softwarecollections/overview/ |
| 107 | + * For CentOS, see here: https://www.softwarecollections.org/en/ |
| 108 | + |
| 109 | + Be aware that collections may not contain the most recent versions. |
| 110 | + |
| 111 | +2. Enable the `IUS repository <https://iuscommunity.org/pages/Repos.html>`_ and |
| 112 | + install one of the `parallel-installable |
| 113 | + <https://iuscommunity.org/pages/TheSafeRepoInitiative.html#parallel-installable-packages>`_ |
| 114 | + Pythons, along with pip, setuptools, and wheel, which are kept fairly up to |
| 115 | + date. |
| 116 | + |
| 117 | + For example, for Python 3.4 on CentOS7/RHEL7:: |
| 118 | + |
| 119 | + sudo yum install python34u python34u-wheel |
| 120 | + |
| 121 | + |
| 122 | +Debian/Ubuntu |
| 123 | +~~~~~~~~~~~~~ |
| 124 | + |
| 125 | +:: |
| 126 | + |
| 127 | + sudo apt-get install python-pip |
| 128 | + |
| 129 | +Replace "python" with "python3" for Python 3. |
| 130 | + |
| 131 | + |
| 132 | +.. warning:: |
| 133 | + |
| 134 | + Recent Debian/Ubuntu versions have modified pip to use the `"User Scheme" |
| 135 | + <https://pip.pypa.io/en/stable/user_guide/#user-installs>`_ by default, which |
| 136 | + is a significant behavior change that can be surprising to some users. |
| 137 | + |
| 138 | + |
| 139 | +---- |
| 140 | + |
| 141 | +.. [1] Currently, there is no "copr" yum plugin available for CentOS/RHEL, so |
| 142 | + the only option is to manually place the repo files as described. |
0 commit comments