How to install pip on Red Hat Enterprise Linux?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • Red Hat Software Collections

Issue

Is the pip available in RHSCL for RHEL6 and RHEL7?

Resolution

WARNING: Pip can overwrite your system python libraries, use a virtualenv whenever possible to avoid issues when packages are upgraded using Red Hat provided RPM's.

  • For RHEL6, python27-python-pip is available in RHSCL(Red Hat Software Collections) 2.0. Refer to RHBZ#994189 for all history regarding the package and RHSA-2015-1064 is the errata announcement.
  • For RHEL7, pip for python2 and python3 are available in RHSCL too. Please obtain the packages by enabling the RHSCL repository.

Here are some example steps for RHEL7:

# subscription-manager repos --enable rhel-server-rhscl-7-rpms
# yum install python27-python-pip -y
# scl enable python27 bash
# pip install --upgrade pip

Test installation of some modules:

# pip install pyvim pyVmomi

Note: When you close the current bash you will need to run the scl enable command again as the change is not persistent, more info about that can be found here

Diagnostic Steps

Verify the following commands:

#  rpm -qf /bin/scl
scl-utils-20130529-18.el7_4.x86_64

# scl -l
python27

# scl enable python27 bash

#which pip
/opt/rh/python27/root/usr/bin/pip

# pip -V
pip 8.1.2 from /opt/rh/python27/root/usr/lib/python2.7/site-packages (python 2.7)

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.