Install Python 2.7 on CentOS 6.x

CentOS 6.x uses python 2.6 for various things.  It is the default install and Python 2.7 is not available as a typical install but I  had a need for it and found a solution that worked for me.

yum -y update
yum install -y centos-release-SCL
yum install -y python27
scl enable python27 bash

The test.

python -V
Python 2.7.13
cat /etc/redhat-release
CentOS release 6.9 (Final)

If you type exit, and type python -V, this will revert to the existing python version.  The scl enable is not persistent.

[root@python ~]# which python
/usr/bin/python
[root@python ~]# python -V
Python 2.6.6
[root@python ~]# scl enable python27 bash
[root@python ~]# which python
/opt/rh/python27/root/usr/bin/python
[root@python ~]# python -V
Python 2.7.13
[root@python ~]# exit
exit
[root@python ~]# which python
/usr/bin/python
[root@python ~]# python -V
Python 2.6.6

Source(s)
http://whatizee.blogspot.com/2016/02/installing-python-27x-on-centos-6566.html
https://github.com/h2oai/h2o-2/wiki/installing-python-2.7-on-centos-6.3.-follow-this-sequence-exactly-for-centos-machine-only