Installing Python 2.7 on older RHEL-based package installations
Steps for installing Python 2.7 on older distributions such as CentOS 6.5.
Installing Python 2.7 on older distributions such as CentOS 6.5.
Procedure
-
Verify your Python version:
python -V
-
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
-
Verify the update:
python -V
Python 2.7.8
-
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.