Installing Python 2.7 on older RHEL-based package installations

Steps for installing Python 2.7 on older distributions such as CentOS 6.5.

How to install Python 2.7 on older distributions such as CentOS 6.5.

Procedure

  1. Verify your Python version:
    python -V
  2. If Python is not version 2.7.x, install it from the Software Collections ( SCL ) Repository:
    sudo yum update
    $ sudo yum install scl-utils
    $ sudo yum install centos-release-scl-rh
    $ sudo yum install python27
    $ sudo scl enable python27 bash
  3. Verify the update:
    python -V
    
    Python 2.7.8
  4. After logging out or restarting, you must enable python 2.7:
    sudo scl enable python27 bash
    Enabling Python 2.7 in .bash_profile or .bashrc causes the machine to hang because CentOS 6 relies on Python 2.6 for Yum.