centos5.x upgrade Python to python2.7 version tutorial

Source: Internet
Author: User
First download the python2.7.3 version to the official website, compile and install
Copy CodeThe code is 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 soft connect to the new location
Copy CodeThe code is 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 CodeThe code is as follows:


$vim Vim/usr/bin/yum


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

Installing Easy_install
Copy the Code code as follows:


$yum Install Python-setuptools


Then install Python-setuptools to pypi Web site download Python-setuptools, version to be the same version as Yum, or run the time will appear:
Copy CodeThe code is as follows:


$ easy_install RSA
Traceback (most recent):
File "/usr/bin/easy_install", line 5, in
from pkg_resources import load_entry_point
Importerror:no module named Pkg_resources


Then:
Copy the 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


installed successfully this makes it easy to use Easy_install to install the Python library
  • Related Article

    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.