CentOS 6.5 comes with a python version of 2.6.6, but with more than 2.7.x in daily work, you can upgrade to meet your needs. However, the previous version of Python has been deeply dependent on the system, so you cannot drop the version of Python uninstall, only new installation.
Download the Python 2.7.6 installation package:
wget https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
Unzip the installation:
TAR-XVF python-2.7.6.tgz
CD Python-2.7.6
./configure--prefix=/usr/local/python2.7
Make
Make install
3. Change the default Python version of the system to Python 2.7
Ln-fs/usr/local/python2.7/bin/python2.7/usr/bin/python
4. View the Python version
[Email protected] ~]# python-v python 2.7.6
Precautions:
After upgrading the version, the use of Yum does not work properly, you need to change the Python version of the system comes with the Python version, modify the method:
Sed-i ' s/bin\/python/bin\/python2.6/'/usr/bin/yum
At this point, the Python version of the CentOS 6.5 system has been successfully upgraded to the 2.7.6 version.
This article is from the "Running Snail" blog, please make sure to keep this source http://441274636.blog.51cto.com/5054639/1893362
CentOS python 2.6 upgrade to Python 2.7