Centos6.6 Upgrade Python version

Source: Internet
Author: User

CentOS native Python is 2.6.6 and can be viewed by the following command

# python-v 2.6. 6

1. Download the Python version you need

To download the required version of the https://www.python.org/downloads/website, the current version of Linux used is. tgz or. tar.xz version.

2. Unzip the download file

Taking Tar.xz as an example

# xz-d PYTHON-2.7.8.TAR.XZ#TAR-XVF Python-2.7.8.tar

3. Compiling & Installing

Because the compilation requires GCC support, if it is not installed, install GCC, #yum installed GCC

# CD Python-2.7.8#./configure#make all           #make install#make clean#make Distclean

4, cancel the original link, create a new version of the link

# mv/usr/bin/python/usr/bin/python2.6.6#ln-s/usr/local/bin/python2.7/usr/bin/python

5. Check the current version of Python

# python-v 2.7. 8

6, because Yum does not have compatible python2.7, it is necessary to change the red part below from #!/usr/bin/python to #!/usr/bin/python2.6.

Nano/usr/bin/yum

#!/usr/bin/python

Modified to:

#!/usr/bin/python2.6

Centos6.6 Upgrade Python version

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.