This article describes a way to upgrade your own Python 2.6.6 to 2.7.8 on CentOS 6.5.
Look at the information on the Internet, basically said that because the old version of the CentOS system Python has been deeply dependent, so uninstall the original Python or directly upgrade to 2.7.x is not a particularly good solution. It is only appropriate to install a new python.
1. Download 2.7.8 version of Python (2.7.x should be available), gzipped source tar Ball (2.7.8) (SIG), the command is as follows:
wget https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz
2. Unzip the installation, the command is as follows:
tar -xvf python-2.7. 8 . TGZCD Python-2.7. 8
. /configure--prefix=/usr/local/python2. 7 Make Make Install
3. Create a link to make the system default Python become python2.7
Ln -fs/usr/local/python2. 7/bin/python2. 7 /usr/bin/python
4. View the Python version and make sure it's up to date
Python-v
5. Modify the Yum configuration (because 2.7.x may make yum not work)
vim/usr/bin/Yum
Modify the #!/usr/bin/python of the first line to the original Python version address of the system #!/usr/bin/python2/6
OK, you are done, Python has successfully upgraded to 2.7.8
How to upgrade Python on Centos 6.x