CentOS python 2.6 upgrade to Python 2.7

Source: Internet
Author: User

CentOS 6.5 comes with a python version of 2.6.6, but with more than 2.7.x in daily work, you can upgrade to meet your needs. However, the previous version of Python has been deeply dependent on the system, so you cannot drop the version of Python uninstall, only new installation.


    1. Download the Python 2.7.6 installation package:

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

    2. Unzip the installation:

TAR-XVF python-2.7.6.tgz

CD Python-2.7.6

./configure--prefix=/usr/local/python2.7

Make

Make install

3. Change the default Python version of the system to Python 2.7

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

4. View the Python version

[Email protected] ~]# python-v python 2.7.6

Precautions:

After upgrading the version, the use of Yum does not work properly, you need to change the Python version of the system comes with the Python version, modify the method:

Sed-i ' s/bin\/python/bin\/python2.6/'/usr/bin/yum


At this point, the Python version of the CentOS 6.5 system has been successfully upgraded to the 2.7.6 version.


This article is from the "Running Snail" blog, please make sure to keep this source http://441274636.blog.51cto.com/5054639/1893362

CentOS python 2.6 upgrade to Python 2.7

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.