在使用pip安装时报错Can’t connect to HTTPS URL because the SSL module is not available
openssl依赖版本过低
上openssl官网下载1.0.2或者1.1之后的openssl包,编译安装。我选择的是1.0.2r
wget http://www.openssl.org/source/openssl-1.0.2r.tar.gz
tar zxvf openssl-1.0.2r.tar.gz
cd openssl-1.0.2r/
./config --prefix=/opt/openssl1.0.2r --openssldir=/opt/openssl1.0.2r/openssl no-zlib
make && make install
echo "/opt/openssl1.0.2r/lib" >> /etc/ld.so.conf
修改python3.7源码包目录中的Modules/Setup参数,修改ssl目录并将下面三行注释去掉
vim /root/Python-3.7.7/Modules/Setup
cd /root/Python-3.7.7
make && make install
验证pip
pip3 list
Package Version
---------- -------
pip 19.2.3
psutil 2.0.0
setuptools 41.2.0
XlsxWriter 1.3.2
WARNING: You are using pip version 19.2.3, however version 20.2.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.