Note: Root privileges are required
To view the Python version:
Python--version
1. Download Python-2.7.12
wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz
2. Unzip
Tar zxvf python-2.7.12.tgz
3. Change the working directory
CD Python-2.7.12
4. Installation
./configure
Make all
Make install
Make clean
Make Distclean
5. View version Information
/usr/local/bin/python2.7-v
6. Establish a soft connection so that the system default Python points to python2.7
#mv/usr/bin/python/usr/bin/python2.6.6
#ln-S/usr/local/bin/python2.7/usr/bin/python
7. Re-examine the Python version
#python-V
8 Resolve system Python soft link to Python2.7 version, because Yum is not compatible with Python 2.7, Yum does not work properly and needs to specify the Python version of Yum
#vi/usr/bin/yum
The file header is
#!/usr/bin/python
Change into
#!/usr/bin/python2.6.6
CentOS 6.4 Upgrade Python to version 2.7.12