安装个新的python,结果pip一直不能用,不能联网,是因为python安装的时候,没有安装ssl模块
这个模块对应的软件是openssl
要求版本比较特殊
Could not build the ssl module!
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host().
我用yum安装的版本只有,1.0.1.不满足
所以
wget https://www.openssl.org/source/old/1.0.2/openssl-1.0.2.tar.gz
tar zxvf openssl-1.0.2.tar.gz
cd openssl-1.0.2
mkdir build
./config
./config --prefix=`pwd`/build/ --openssldir=`pwd`/build
make -j 10
make install
安装openssl过程中,如果在make install 出现install_sw Error 1错误。则因为安装目录在软件主目录,不可覆盖原始文件,所以mkdir build,安装在此处
之后进入python目录
./configure --prefix=`pwd` --with-openssl=~/software/openssl-1.0.2/build/
make -j 10
make install
成了