How to upgrade Python on Centos 6.x

Source: Internet
Author: User

This article describes a way to upgrade your own Python 2.6.6 to 2.7.8 on CentOS 6.5.

Look at the information on the Internet, basically said that because the old version of the CentOS system Python has been deeply dependent, so uninstall the original Python or directly upgrade to 2.7.x is not a particularly good solution. It is only appropriate to install a new python.

1. Download 2.7.8 version of Python (2.7.x should be available), gzipped source tar Ball (2.7.8) (SIG), the command is as follows:

wget https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz

2. Unzip the installation, the command is as follows:

tar -xvf python-2.7. 8 . TGZCD Python-2.7. 8
. /configure--prefix=/usr/local/python2. 7 Make Make Install

3. Create a link to make the system default Python become python2.7

Ln -fs/usr/local/python2. 7/bin/python2. 7 /usr/bin/python

4. View the Python version and make sure it's up to date

Python-v

5. Modify the Yum configuration (because 2.7.x may make yum not work)

vim/usr/bin/Yum

Modify the #!/usr/bin/python of the first line to the original Python version address of the system #!/usr/bin/python2/6

OK, you are done, Python has successfully upgraded to 2.7.8

How to upgrade Python on Centos 6.x

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.