1. Is pip the same for 3.4+

    No, it's not. A single pip installation serves a single Python distribution (pip2.7/pip3.4/pip3.5 etc).

  2. Since Python 3.5, pip is already bundled with the python distribution, so you can just run python3.6 -m pip instead of pip.

  3. Python 3.6 is not available in CentOS 7 vanilla repo. I usually resort to IUS repo when needing to install a fresh Python on CentOS. It always has the most recent Python version, the current one being 3.6.5. It also offers a correspondent pip package.

    $ yum install https://centos7.iuscommunity.org/ius-release.rpm
    $ yum install python36u python36u-devel python36u-pip
    

    Unfortunately, IUS doesn't offer a package for Python 3.7 yet so if you are looking for Python 3.7 on CentOS 7, building from source is your only option.

Edit: when yum is not an option

You should prefer the bootstrapping solution described in this answer as it is the most reliable way to get a working pip installed.

Answer from hoefling on Stack Overflow
🌐
Red Hat
developers.redhat.com › blog › 2018 › 08 › 13 › install-python3-rhel
How to install multiple versions of Python on Red Hat Enterprise Linux | Red Hat Developer
February 27, 2024 - In addition, for installing the pip package installer, add on the -pip extension to the version of python being installed, for example: ... $ sudo subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms $ yum group install ...
Discussions

Installing Python 3 on RHEL - Stack Overflow
Also, the top voted answer gives ... yum and other RHEL admin tools. Take a look at /bin/yum, it is a Python script that starts with #!/usr/bin/python. If you compile Python from source, do not do a make install as root. That will overwrite /usr/bin/python. If you break yum it can be difficult to restore your system. For more info, see How to install Python 3, pip, venv, virtualenv, ... More on stackoverflow.com
🌐 stackoverflow.com
How to install pip with Python 3? - Stack Overflow
You can usually install the package ... of Python is older than 2.7.9 or 3.4, or if your system did not include it for whatever reason. Instructions for some of the more common distros follow. ... On CentOS 7, you have to install setup tools first, and then use that to install pip, as there is no direct package for it. sudo yum install ... More on stackoverflow.com
🌐 stackoverflow.com
Trying to install pip3 in Amazon Linux
I have setup notes from a year ago and this was working then. Did they break something? More on reddit.com
🌐 r/aws
7
1
April 22, 2021
python 3.4 - How to install pip in CentOS 7? - Stack Overflow
If you are installing on OS X 10.11, you may try running the xcode setup again: xcode-select --install 2016-04-16T16:26:27.323Z+00:00 ... 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 ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
CyberITHub
cyberithub.com › how-to-install-pip3-utility-on-linux-rhel-centos-7-8-easy-steps
How to Install PIP3 utility on Linux(RHEL/CentOS 7/8){Easy Steps} | CyberITHub
March 6, 2021 - After successful update you can now go ahead and install pip3 tool using yum install python3-pip -y command as shown below.
Top answer
1 of 16
257

Installing from RPM is generally better, because:

  • you can install and uninstall (properly) python3.
  • the installation time is way faster. If you work in a cloud environment with multiple VMs, compiling python3 on each VMs is not acceptable.

Solution 1: Red Hat & EPEL repositories

Red Hat has added through the EPEL repository:

  • Python 3.4 for CentOS 6
  • Python 3.6 for CentOS 7

[EPEL] How to install Python 3.4 on CentOS 6

sudo yum install -y epel-release
sudo yum install -y python34

# Install pip3
sudo yum install -y python34-setuptools  # install easy_install-3.4
sudo easy_install-3.4 pip

You can create your virtualenv using pyvenv:

pyvenv /tmp/foo

[EPEL] How to install Python 3.6 on CentOS 7

With CentOS7, pip3.6 is provided as a package :)

sudo yum install -y epel-release
sudo yum install -y python36 python36-pip

You can create your virtualenv using pyvenv:

python3.6 -m venv /tmp/foo

If you use the pyvenv script, you'll get a WARNING:

$ pyvenv-3.6 /tmp/foo
WARNING: the pyenv script is deprecated in favour of `python3.6 -m venv`

Solution 2: IUS Community repositories

The IUS Community provides some up-to-date packages for RHEL & CentOS. The guys behind are from Rackspace, so I think that they are quite trustworthy...

https://ius.io/

Check the right repo for you here:

https://ius.io/setup

[IUS] How to install Python 3.6 on CentOS 6

sudo yum install -y https://repo.ius.io/ius-release-el6.rpm
sudo yum install -y python36u python36u-pip

You can create your virtualenv using pyvenv:

python3.6 -m venv /tmp/foo

[IUS] How to install Python 3.6 on CentOS 7

sudo yum install -y https://repo.ius.io/ius-release-el7.rpm
sudo yum install -y python36u python36u-pip

You can create your virtualenv using pyvenv:

python3.6 -m venv /tmp/foo
2 of 16
207

It is easy to install python manually (i.e. build from source):

  1. Download (there may be newer releases on Python.org):

     $ wget https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tar.xz
    
  2. Unzip

     $ tar xf Python-3.* 
     $ cd Python-3.*
    
  3. Prepare compilation

     $ ./configure
    
  4. Build

     $ make
    
  5. Install

     $ make install
    

    OR if you don't want to overwrite the python executable (safer, at least on some distros yum needs python to be 2.x, such as for RHEL6) - you can install python3.* as a concurrent instance to the system default with an altinstall:

     $ make altinstall
    

Now if you want an alternative installation directory, you can pass --prefix to the configurecommand.

Example: for 'installing' Python in /opt/local, just add --prefix=/opt/local.

After the make install step: In order to use your new Python installation, it could be, that you still have to add the [prefix]/bin to the $PATH and [prefix]/lib to the $LD_LIBRARY_PATH (depending of the --prefix you passed)

Top answer
1 of 16
892

edit: Manual installation and use of setuptools is not the standard process anymore.

If you're running Python 2.7.9+ or Python 3.4+

Congrats, you should already have pip installed. If you do not, read onward.

If you're running a Unix-like System

You can usually install the package for pip through your package manager if your version of Python is older than 2.7.9 or 3.4, or if your system did not include it for whatever reason.

Instructions for some of the more common distros follow.

Installing on Debian (Wheezy and newer) and Ubuntu (Trusty Tahr and newer) for Python 2.x

Run the following command from a terminal:

sudo apt-get install python-pip 

Installing on Debian (Wheezy and newer) and Ubuntu (Trusty Tahr and newer) for Python 3.x

Run the following command from a terminal:

sudo apt-get install python3-pip
Note:

On a fresh Debian/Ubuntu install, the package may not be found until you do:

sudo apt-get update

Installing pip on CentOS 7 for Python 2.x

On CentOS 7, you have to install setup tools first, and then use that to install pip, as there is no direct package for it.

sudo yum install python-setuptools
sudo easy_install pip

Installing pip on CentOS 7 for Python 3.x

Assuming you installed Python 3.4 from EPEL, you can install Python 3's setup tools and use it to install pip.

# First command requires you to have enabled EPEL for CentOS7
sudo yum install python34-setuptools
sudo easy_install pip

If your Unix/Linux distro doesn't have it in package repos

Install using the manual way detailed below.

The manual way

If you want to do it the manual way, the now-recommended method is to install using the get-pip.py script from pip's installation instructions.

Install pip

To install pip, securely download get-pip.py

Then run the following (which may require administrator access):

python get-pip.py 

If setuptools is not already installed, get-pip.py will install setuptools for you.

2 of 16
237

I was able to install pip for python 3 on Ubuntu just by running sudo apt-get install python3-pip.

🌐
Automate the Boring Stuff
automatetheboringstuff.com › 1e › appendixa
Appendix A – Installing Third-Party Modules
While pip comes automatically installed with Python 3.4 on Windows and OS X, you must install it separately on Linux. To install pip3 on Ubuntu or Debian Linux, open a new Terminal window and enter sudo apt-get install python3-pip. To install pip3 on Fedora Linux, enter sudo yum install python3-pip ...
🌐
LayerStack
layerstack.com › resources › tutorials › How-to-install-Python3-on-CentOS-Ubuntu-Debian-Cloud-Servers
LayerStack Tutorials - LayerStack - How to install Python 3 on CentOS, Ubuntu & Debian Cloud Servers
July 6, 2020 - # sudo yum -y install python36u-pip or # sudo apt install -y python3-pip · The Pip is used to install and manage programming packages for the development projects.
Find elsewhere
Top answer
1 of 6
48

You have to enable the EPEL repo, use:

yum --enablerepo=extras install epel-release

This command will install the correct EPEL repository for the CentOS version you are running.

After this you will be able to install python-pip.

2 of 6
11

I was going crazy about the same issue. The reason why yum couldn't find python-pip was that it is not called python-pip anymore. Starting with EPEL Version 7 it is renamed to identify the python version. On my centOS machine i can find now the following python*-pip packages.

[root@asdasdasdasdsa ~]# yum info python*-pip
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.rz.uni-frankfurt.de
 * epel: mirrors.mit.edu
 * extras: mirror.23media.de
 * updates: ftp.plusline.de
Available Packages
Name        : python2-pip
Arch        : noarch
Version     : 8.1.2
Release     : 5.el7
Size        : 1.7 M
Repo        : epel/x86_64
Summary     : A tool for installing and managing Python 2 packages
URL         : http://www.pip-installer.org
License     : MIT
Description : Pip is a replacement for `easy_install
            : <http://peak.telecommunity.com/DevCenter/EasyInstall>`_.  It uses mostly the
            : same techniques for finding packages, so packages that were made
            : easy_installable should be pip-installable as well.

Name        : python34-pip
Arch        : noarch
Version     : 8.1.2
Release     : 5.el7
Size        : 1.7 M
Repo        : epel/x86_64
Summary     : A tool for installing and managing Python3 packages
URL         : http://www.pip-installer.org
License     : MIT
Description : Pip is a replacement for `easy_install
            : <http://peak.telecommunity.com/DevCenter/EasyInstall>`_.  It uses mostly the
            : same techniques for finding packages, so packages that were made
            : easy_installable should be pip-installable as well.
🌐
Reddit
reddit.com › r/aws › trying to install pip3 in amazon linux
r/aws on Reddit: Trying to install pip3 in Amazon Linux
April 22, 2021 -

I did the following and can't get pip3 installed. Any help is appreciated!

sudo yum install python3 pip3
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Package python3-3.7.9-1.amzn2.0.2.x86_64 already installed and latest version
No package pip3 available.
Nothing to do

I ran sudo yum update previous to this with no issues.

The posts I am finding state that this should work.

This is in the latest AMI on Amazon Linux 2.

🌐
Vinod Pandey
vinodpandey.com › how-to-install-python3-on-centos-7
How to Install Python 3 on Centos 7 | Vinod Pandey
January 10, 2021 - In this tutorial we will install Python 3.6, 3.7, 3.8 & 3.9 on CentOS 7. The default python version in CentOS 7 is 2.7.5. If we forcefully upgrade or replace this version, yum and other utitiles may break causing the OS to become unstable. Instead of upgrading/replacing default python, we will install the new version of python using alternate install method. This setup will also install corresponding pip for each python version separately.
🌐
Linux TLDR
linuxtldr.com › home › python 3.13 installation on linux with hands-on examples
Python 3.13 Installation on Linux with Hands-on Examples
October 10, 2024 - $ sudo apt install python3-pip -y #Debian, Ubuntu, or Pop!_OS $ sudo dnf install python3-pip -y #Fedora $ sudo yum install python3-pip -y #Red Hat, CentOS $ sudo pacman -Sy python-pip #Arch, Manjaro, or EndeavourOS · The command above will ...
🌐
Medium
medium.com › pythoneers › installing-python-3-on-amazon-linux-with-openssl-and-pip-dependencies-2e9c76b91018
Installing Python 3 on Amazon Linux with OpenSSL and Pip Dependencies | by Rihem Larbi | The Pythoneers | Medium
July 22, 2024 - $sudo yum groupinstall "Development Tools" -y $sudo yum install gcc bzip2-devel libffi-devel -y · OpenSSL is an important dependancy when installing Pyhton3 as it provides the necessary cryptographic functions and protocols for Python applications to establish secure connections over networks. PS: you should install OpenSSL11 because for Python version 3.10.x + we need OpenSSL 1.1.1+
🌐
Python Packaging
packaging.python.org › guides › installing-using-linux-tools
Installing pip/setuptools/wheel with Linux Package Managers — Python Packaging User Guide
Enable the IUS repository and install one of the parallel-installable Pythons, along with pip, setuptools, and wheel, which are kept fairly up to date. ... Recent Debian/Ubuntu versions have modified pip to use the “User Scheme” by default, which is a significant behavior change that can be surprising to some users. ... Currently, there is no “copr” yum ...
🌐
Linux Stans
linuxstans.com › how-to-install-python-centos
How to Install Python 3.10 (or 3.11) on CentOS - Linux Stans
January 24, 2022 - I tried running the exact steps from the tutorial again and installed pip3 and websockets. It all worked fine: 9 yum install epel-release 10 yum install python3-pip 11 pip3 install websockets 12 history
🌐
DevOpsSchool.com
devopsschool.com › blog › installing-python-3-on-linux-centos-ubuntu-windows
Python Tutorials: Installing Python 3 on Linux, Centos, Ubuntu & Windows
sudo yum -y install wget make gcc openssl-devel bzip2-devel cd /tmp/ wget https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgz tar xzf Python-3.7.9.tgz cd Python-3.7.9 ./configure --enable-optimizations sudo make altinstall sudo ln -sfn ...
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to install pip on centos 8
How to Install Pip on CentOS 8
January 27, 2025 - Note: If you’re concerned that Python 2 may not have been installed, verify the installation by entering sudo yum –y install python2. The system should report nothing to do. ... You have installed Pip for Python 2 and Python 3 on your CentOS ...
🌐
InMotion Hosting
inmotionhosting.com › inmotion hosting home › support › server technologies › linux › how to install python 3.9 on centos 7
How to Install Python 3.9 on CentOS 7 | InMotion Hosting
March 21, 2025 - Now that we have PIP installed, ... requisite software packages using the following command: sudo yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel · Once that is done, navigate to the /usr/local/src directory: ...
🌐
Linux Stans
linuxstans.com › install-pip-centos
How to Install Pip (Python 3) on CentOS - Linux Stans
March 4, 2024 - And you get a version of the pip that’s installed – it means that an older version of pip is installed and it’s meant for Python 2. Follow the steps below to install Pip3 for Python 3. The next step is to update your CentOS system with the following command: yum update -y ·
🌐
Medium
rakeshjain-devops.medium.com › how-to-install-python-3-on-centos-7-7-using-yum-and-source-and-set-as-default-1dee13396f7
How to Install Python 3 on CentOS 7.7 using yum/source and set as Default | by Rakesh Jain | Medium
October 13, 2020 - Another helpful idea to consider is that PIP, the Python package manager for Python 3, is installed alongside the Python 3 package, so we don’t have to worry about that as an additional installation step. Install development tools and some prerequisite packages. [root@centos7 ~]# yum groupinstall -y "Development Tools" && yum install gcc openssl-devel bzip2-devel libffi-devel -y