CentOS 7 EPEL now includes Python 3.4: yum install python34
However, when I try that, even though Python 3.4 installs successfully, it doesn't appear to install pip. Which is weird, because pip
should be included by default with Python 3.4. which pip3
doesn't find anything, nor does which pip
.
How do I access pip from the Python 3.4 package in CentOS 7 EPEL release?
The easiest way I've found to install pip3 (for python3.x packages) on CentOS 7 is:
You'll need to have the EPEL repository enabled before hand, of course.
You should now be able to run commands like the following to install packages for python3.x:
The CentOS 7 yum package for python34 does include the
ensurepip
module, but for some reason is missing the setuptools and pip files that should be a part of that module. To fix, download the latest wheels from PyPI into the module's_bundled
directory (/lib64/python3.4/ensurepip/_bundled/
):then edit
__init__.py
to match the downloaded versions:after which
python3.4 -m ensurepip
works as intended. Ensurepip is invoked automatically every time you create a virtual environment, for example:Hopefully RH will fix the broken Python3.4 yum package so that manual patching isn't needed.
Update: The python34 bug mentioned below has finally been fixed. It is a perfectly fine choice now.
Rather than using broken EPEL python34 packages, you can enable the IUS repo and have it work properly.
The main
python34u
andpython35u
IUS packages include the pyvenv tool (/usr/bin/pyvenv-3.4
or/usr/bin/pyvenv-3.5
) that includes bundled wheels of pip and setuptools for bootstrapping virtual environments.The
python34u-pip
andpython35u-pip
IUS packages include/usr/bin/pip3.4
and/usr/bin/pip3.5
respectively. These work just fine to install packages to the system site-packages directory.