Linux Upgrade python2.7 installation Setuptools

Source: Internet
Author: User

Linux is REDHAT4, python2.6 is installed by default, the Python script content that needs to be executed contains the standard library Xml.etree.ElementTree A ITER method used in the library is a new feature of python2.7, so it needs to be upgraded to python2.7

Upgrading python2.7 is relatively simple

wget python2.7 Address

Tar zxvf xxx.tar.gz

./config

Make &&make Install

Replace the old Python:

View current Python version

To install a Python third-party module, you need to first install the Setuptools

The process for installing Setuptools is as follows:

1, download Setuptools wget mode, tar.gz format

2. Unzip the tar zxvf xxxx.tar.gz

3. Enter Setuptools installation directory, compile and install

Python setup.py Build

Python setup.py Install

Execute python setup.py install error: Compression requires the (missing) zlib, stating that there is no zlib module

Problem solving:

1, RPM-QA | grep zlib View

System only Zlip module: zlib-1.2.3-29.el6.i686

2, also lacks zlib-devel module, direct Baidu search zlib-devel-1.2.3-29.el6.i686.rpm

RPM-IVH zlib-devel-1.2.3-29.el6.i686.rpm

After the installation is complete, RPM-QA | grep zlib, you can see the zlib and Zlib-devel two modules

3. Enter the python2.7 directory, reinstall the build Make&&make install

4. Enter Setuptools directory, Python setup.py install, reinstall successful

5. Then you can install PIP.

Linux Upgrade python2.7 installation Setuptools

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.