Centos6.3 upgrade python to 2.7 (delete old version)

Source: Internet
Author: User

Centos6.3 upgrade python to 2.7

Yum groupinstall "Development tools"-y
Yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel-y

Cd/tmp
Wget -- no-check-certificate https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
Tar xf Python-2.7.6.tar.xz
Cd Python-2.7.6
./Configure -- prefix =/usr/local
Make & make altinstall

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

Which python


Wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
/Usr/local/bin/python2.7 ez_setup.py
/Usr/local/bin/easy_install-2.7 pip
Which pip
Which easy_install

Delete old

/Usr/bin/pip -- version
/Usr/bin/easy_install -- version

Cd/usr/local/bin
Mv pip pip2.6
Mv easy_install easy_install-2.6
Ln-s pip2.7 pip
Ln-s easy_install-2.7 easy_install


Cd/usr/bin/
Mv pip. old
Mv pip2 pip2.old
Mv pip2.6 pip2.6.old

Mv easy_install easy_install.old
Mv easy_install-2.6 easy_install-2.6.old

Update PIP

Pip install -- upgrade pip

All new python files are installed under/usr/local/bin.

In general, the old version has not been deleted and renamed and backed up. This is an advantage of the Linux kernel system. The software can be renamed without the need to delete or registry anything.

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.