Summary of questions about installing Python under CentOS

Source: Internet
Author: User
Tags install openssl

Python (https://www.python.org/ftp/python/)

First, tool installation

1, the installation of Python

1 tar vxf Python-2.7.13. tgz2 cd Python-2.7.13. tgz3 ./Configure 4 make && make install

2, Installation Setuptools
Download link

https://pypi.python.org/packages/ff/d4/209f4939c49e31f5524fa0027bf1c8ec3107abaf7c61fdaad704a648c281/ Setuptools-21.0.0.tar.gz#md5=81964fdb89534118707742e6d1a1ddb4

1 tar vxf setuptools-21.0. 0.tar.gz2 cd setuptools-21.0. 03 python setup.py Install

3. Install Pip
Download link
https://pypi.python.org/packages/41/27/9a8d24e1b55bd8c85e4d022da2922cb206f183e2d18fee4e320c9547e751/ Pip-8.1.1.tar.gz#md5=6b86f11841e89c8241d689956ba99ed7

1 tar vxf pip-8.1.1. tar.gz2 cd pip-8.1.13 python setup.py install

Second, problem solving

1. Problem: Configure:error:no acceptable C compiler found in $PATH

1 yum-y install GCC

2. Problem: Yum error occurred: No module named Yum
Workaround: Because the Yum command is incompatible with python2.7, the/usr/bin/yum file needs to be modified to change the first line from "#!/usr/bin/python" to "#!/usr/bin/python2.6"

3. Question: "Compression requires the (missing) zlib module"
Solve:

1 Yum Install zlib 2 Yum install Zlib-devel

After the download succeeds, go to the python2.7 directory and re-execute

1  Make 2 make install


The previously executed soft connection still takes effect

Then go to the Setuptool directory and reinstall

1 python setup.py install

4. Problem: Pip use error importerror:cannot import name Httpshandle
Workaround: The reason is that the Openssl,openssl-devel two packages are not installed correctly. Use down the command to install:

1 Yum install openssl-y2 yum install openssl-devel-y

After the installation is complete, reinstall [Python] (Http://lib.csdn.net/base/python):

1 cd python2.72 ./Configure3 make install

Install PIP again normally.

Summary of questions about installing Python under CentOS

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.