CentOS python2.6 upgrade to python2.7

Source: Internet
Author: User

Basic Environment

Yum-y install wget gcc xz tar

Install zlib (if not installed zlib Setuptools may error "Compression requires the (missing) zlib module")

1. wget http://prdownloads.sourceforge.net/libpng/zlib-1.2.11.tar.gz?download

2. TAR-XVF zlib-1.2.11.tar.gz

3. CD zlib-1.2.11 &&./configure && make && make install

Install Python

1. wget HTTPS://WWW.PYTHON.ORG/FTP/PYTHON/2.7.12/PYTHON-2.7.12.TAR.XZ

2. xz-d python-2.7.12.tar.xz && tar-xvf Python-2.7.12.tar

3. CD Python-2.7.12 &&./configure && make && Makeinstall

4. mv/usr/bin/python/usr/bin/python2.6.6

5. Ln-s/usr/local/bin/python/usr/bin/python

6. Vim/usr/bin/yum

7. Modify the head #!/usr/bin/python2.6.6

If Python error "error while loading Sharedlibraries:libpython2.7.so.1.0:cannot open shared object file:no such file Ordirec Tory

vim/etc/ld.so.conf next line plus/usr/local/lib and execute /sbin/ldconfig-v

Installing Setuptools

1. wget https://pypi.python.org/packages/a9/23/720c7558ba6ad3e0f5ad01e0d6ea2288b486da32f053c73e259f7c392042/ Setuptools-36.0.1.zip#md5=430eb106788183eefe9f444a300007f0

2. Unzip Setuptools-36.0.1.zip && CD setuptools-36.0.1

3. Python setup.py Install

4. Easy_install pip

http://blog.csdn.net/shaojunbo24/article/details/52300428

http://blog.csdn.net/ab198604/article/details/8681851

http://blog.csdn.net/laiahu/article/details/6903100

http://blog.csdn.net/shanliangliuxing/article/details/18499625

CentOS python2.6 upgrade to python2.7

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.