The day before yesterday installed in CentOS python2.7.12 and python3.5.2, today to install two versions of PIP, from the official download get-pip.py, using Python get-pip.py, error, unable to install. By looking for the reason, it was finally installed.
Let me explain here:
1. Problems that arise
1), no zlib library
2), no Httpshander library
2. Solution
Before the two versions of Python are installed, two libraries Zlib-devel and openssl-devel need to be installed, and after the installation is complete, the PIP can be installed properly after the Python is compiled and installed.
To summarize, install the process:
1. Installation Library
Yum Install Zlib-devel openssl-devel-y
Install the two development libraries, if not installed, there will be no zlib and httpshander libraries after the Python installation is complete.
2. Install Python
./configure--prefix=/usr/local/python27
Make && make install
Ln-s/usr/local/python27/bin/python2.7/usr/bin/python
python3.5.2
Similar to python2.7.12, slightly different, think about it yourself
3. Install Pip
wget https://bootstrap.pypa.io/get-pip.py--no-check-certificate
Python get-pip.py
Install PIP under python3.5.2 similar to 2.7, please think about it, there is no writing.
This article is from the "Road" blog, please make sure to keep this source http://4330156.blog.51cto.com/4320156/1828980
Install PIP under multiple versions of Python