Home >Backend Development >Python Tutorial >How to upgrade python 2.6.6 to python 2.7.x version
1. Download python2.7.x
wget https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
2. Unzip, 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. Establish a soft connection and use the system’s default python pointer
mv /usr/bin/python /usr/bin/python2.6.6
ln -s /usr/local/bin/python2.7 /usr/bin/python
5. Check
python -V
6. Be careful when using yum
After solving the problem that the system Python soft link points to the Python2.7 version, because yum is not compatible with Python 2.7, yum cannot work properly. We need to specify the Python version of yum
vim /usr/bin/yum Change the header #!/usr/bin/python to #!/usr/bin/python2.6.6 (just backed up)
The above is the method introduced by the editor to upgrade python 2.6.6 to python 2.7.x version. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for your support of the Script House website!