This article mainly introduces how to upgrade python2.6.6 to python2.7.x. it is very good and has reference value. if you need it, you can refer to it.
1. download python2.7.x
Wget https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
2. decompress and compile and install
Tar-zxvf Python-2.7.6.tgz & cd Python-2.7.6 &./configure & make all & make install & make clean & make distclean
3. Check installation
/Usr/local/bin/python2.7-V
4. create a soft connection and point
Mv/usr/bin/python/usr/bin/python2.6.6
Ln-s/usr/local/bin/python2.7/usr/bin/python
5. check
Python-V
6. notes for using yum
After the system Python soft link points to Python 2.7, yum cannot work properly because yum is incompatible with Python. we need to specify the Python version of yum.
Vim/usr/bin/yum: add the header #! /Usr/bin/python #! /Usr/bin/python2.6.6 (just backed up)
The above section describes how to upgrade python 2.6.6 to python 2.7.x. I hope it will help you. if you have any questions, please leave a message, the editor will reply to you in a timely manner. I would like to thank you for your support for the script home website!