python2.6 Upgrade 2.7 method and post-upgrade fault handling

Source: Internet
Author: User

The python on the VPS is 2.6 and wants to upgrade to 2.7

1. View the Python version

#python-V

    1. Python 2.6.6


2. Download python2.7

    1. #wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tar.bz2

    2. #tar-JXVF python-2.7.6.tar.bz2

    3. #cd Python-2.7.6


3. Installation

    1. #./configure

    2. #make All

    3. #make Install

    4. #make Clean

    5. #make Distclean


4. View version Information

    1. #/usr/local/bin/python2.7-v


5. Establish a soft connection so that the system default Python points to python2.7

    1. #mv/usr/bin/python/usr/bin/python2.6.6

    2. #ln-S/usr/local/bin/python2.7/usr/bin/python


6. Re-examine the Python version

    1. #python-V


7. Solve the system Python soft link to Python2.7 version, because Yum is not compatible with Python 2.7, so Yum does not work, we need to specify the Python version of Yum

    1. #vi/usr/bin/yum

The file header is
#!/usr/bin/python
Change into
#!/usr/bin/python2.6.6


8. Configure IBUs

Modify the following two files, locate the exec Python line, change the exec python to exec python2.6 save, and exit. The IBUs is back to normal after a reboot.

    1. #vi/usr/bin/ibus-setup

    2. #vi/USR/LIBEXEC/IBUS-UI-GTK


9. Solve the PIP problem

After upgrade, PIP error: Importerror:cannot import name Walk_packages

So PIP also needs to be upgraded to the matching version:
Curl-o Http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
SH Setuptools-0.6c11-py2.7.egg
Easy_install pip


python2.6 Upgrade 2.7 method and post-upgrade fault handling

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.