centos5.x upgrade Python to python2.7 version tutorial _python

Source: Internet
Author: User

First download the python2.7.3 version to the official website, compile and install

Copy Code code as follows:

$wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
$tar ZXVF python-2.7.3.tgz
$CD Python-2.7.3
$./configure
$make && make Install

Then back up the original Python and make the python2.7 a soft connection to the new location
Copy Code code as follows:

$MV/usr/bin/python/usr/bin/python.bak
$LN-S/usr/local/bin/python2.7/usr/bin/python
$python-V

Version hint for 2.7.3
Change Yum to make it work
Copy Code code as follows:

$vim Vim/usr/bin/yum

Change the #/usr/bin/python to #/usr/bin/python2.4 so yum can run normally.

Install Easy_install

Copy Code code as follows:

$yum Install Python-setuptools

Then install Python-setuptools to pypi Web site download Python-setuptools, version to and Yum when the version of the same, otherwise run will appear:
Copy Code code as follows:

$ easy_install RSA
Traceback (most recent call last):
File "/usr/bin/easy_install", line 5, in <module>
From pkg_resources import Load_entry_point
Importerror:no module named Pkg_resources

And then:
Copy Code code as follows:

$wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c5.tar.gz
$tar ZXVF setuptools-0.6c5.tar.gz
$CD setuptools-0.6c5
$python setup.py Install

Installation is successful this makes it easy to use Easy_install to install the Python library.

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.