Home  >  Article  >  Backend Development  >  How to upgrade python 2.6.6 to python 2.7.x version

How to upgrade python 2.6.6 to python 2.7.x version

WBOY
WBOYOriginal
2016-12-05 13:27:171030browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn