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
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