* * * Install ReadLine First, otherwise python fallback and arrow keys cannot be used after upgrade
Yum Install readline-devel.x86_641. #wget www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz2. #tar zxvf python-2.7.8.tgz
3. #cd Python-2.7.8
Build a folder in/usr/local before compiling python27
4.#./configure--enable-shared--prefix=/usr/local/python27 If there is an error no acceptable C compiler found in $PATH, install GCC: #yum Install GCC
#make
#make Install
The old version is not overwritten at this time, then the original/usr/bin/python link is changed to another name
#mv/usr/bin/python/usr/bin/python_old
Link to build a new version of Python
#ln-S/usr/local/python27/bin/python2.7/usr/bin/python #ln-S/usr/local/python27/lib/libpython2.7.so/usr/lib64/ Libpython2.7.so (64-bit system)
#ln-S/usr/local/python27/lib/libpython2.7.so/usr/lib/libpython2.7.so (32-bit system) This time Yum becomes unavailable, to modify Yum, Modify Python to the original old version #vi/usr/bin/yum "#!/usr/bin/python" to "#!/usr/bin/python2.6" (then enter Python to view the information, if you are prompted for error while Loading shared Libraries:libpython2.7.so.1.0:cannot Open Shared object file:no such file or directory, workaround: #vi/etc/ld. so.conf.d/python2.7.conf Join/usr/local/python27/lib Save exit after execution #ldconfig) reference: http://www.linuxidc.com/Linux/2013-03/81117.htm
CentOS Upgrade Python (upgrade from 2.6.6 to 2.7.8)