CentOS Yum originated with Python version 2.6, some libraries are not supported, so decide to compile and install it.
Download 2.7.9 version from https://www.python.org/downloads/release/python-279/, gzipped source tarball Source installation package
Download the source installation package
wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
2. Add compression and Installation
Tar fxvz python-2.7.9.tgz cd Python-2.7.9./configure && make && make install
3. Modify the Configuration
mv/usr/bin/python/usr/bin/python2.6 ln-s/usr/bin/python
Use Python-v to see if the current Python version is 2.7.9
4. Because Yum relies on python, if you try to use Yum to uninstall Python, you will find that you want to uninstall Yum and error, in order to avoid the upgrade caused by Yum is not available, you need to modify the Yum configuration
Which yum shown as:/usr/bin/yum
Vim/usr/bin/yum
change the #!/usr/bin/python to #!/usr/bin/python2.6
CentOS 2.7 Compilation Installation and configuration