pyproject.tomlsetup.py based project?Incomplete
2021-07-26
This section covers how to installpip,Setuptools, andwheel using Linux package managers.
If you’re using a Python that was downloaded frompython.org, then this section does not apply. See theRequirements for Installing Packages section instead.
Note that it’s common for the versions ofpip,Setuptools, andwheel supported by a specific Linux Distribution to be outdated by thetime it’s released to the public, and updates generally only occur for securityreasons, not for feature updates. For certain Distributions, there areadditional repositories that can be enabled to provide newer versions. Therepositories we know about are explained below.
Also note that it’s somewhat common for Distributions to apply patches for thesake of security and normalization to their own standards. In some cases, thiscan lead to bugs or unexpected behaviors that vary from the original unpatchedversions. When this is known, we will make note of it below.
sudodnfinstallpython3-pippython3-wheel
To learn more about Python in Fedora, please visit theofficial Fedora docs,Python Classroom orFedora Loves Python.
CentOS and RHEL don’t offerpip orwheel in their core repositories,althoughSetuptools is installed by default.
To install pip and wheel for the system Python, there are two options:
Enable theEPEL repository usingthese instructions.On EPEL 7, you can install pip and wheel like so:
sudodnfinstallpython3-pippython3-wheel
Since EPEL only offers extra, non-conflicting packages, EPEL does not offersetuptools, since it’s in the core repository.
Enable thePyPA Copr Repo usingthese instructions[1]. You can installpip and wheel like so:
sudodnfinstallpython3-pippython3-wheel
To additionally upgrade setuptools, run:
sudodnfupgradepython3-setuptools
To install pip, wheel, and setuptools, in a parallel, non-system environment(using yum) then there are two options:
Use the “Software Collections” feature to enable a parallel collection thatincludes pip, setuptools, and wheel.
For Redhat, see here:https://developers.redhat.com/products/softwarecollections/overview
For CentOS, see here:https://github.com/sclorg
Be aware that collections may not contain the most recent versions.
Enable theIUS repository andinstall one of theparallel-installablePythons, along with pip, setuptools, and wheel, which are kept fairly up todate.
For example, for Python 3.4 on CentOS7/RHEL7:
sudoyuminstallpython34upython34u-wheel
sudozypperinstallpython3-pippython3-setuptoolspython3-wheel
Firstly, update and refresh repository lists by running this command:
sudoaptupdatesudoaptinstallpython3-venvpython3-pip
Warning
Recent Debian/Ubuntu versions have modified pip to use the“User Scheme” by default, whichis a significant behavior change that can be surprising to some users.
sudopacman-Spython-pip
Currently, there is no “copr” yum plugin available for CentOS/RHEL, sothe only option is to manually place the repo files as described.