1.使用pip报错
报错信息:
Could not fetch URL https://pypi.python.org/simple/flask/: There was a problem confirming the ssl certificate: Can’t connect to HTTPS URL because the SSL module is not available. - skipping
解决方法:
修改安装目录下 Modules/Setup如下部分信息为:
.# Socket module helper for SSL support; you must comment out the other
.# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/ssl
_ssl _ssl.c
-DUSE_SSL -I
(
S
S
L
)
/
i
n
c
l
u
d
e
−
I
(SSL)/include -I
(SSL)/include−I(SSL)/include/openssl
-L$(SSL)/lib -lssl -lcrypto
2.使用make cache后重新编译make&&make install报错:
error “libssl is too old and does not support X509_VERIFY_PARAM_set1_host()”
解决方法:
下载ssl安装包进行安装
wget https://www.openssl.org/source/openssl-1.1.0l.tar.gz
tar openssl-1.1.01.tar.gz
cd openssl-1.1.01
./config shared zlib-dynamic
make&&make install
备份原有openssl
mv /usr/bin/openssl /usr/bin/openssl.old
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
3.如报错为ibcrypto.so.1.0.01: cannot open shared object file: No such file or directory
#配置lib的软连接
ln -s /usr/local/ssl/lib/libssl.so /usr/lib/libssl.so.1.0.01
ln -s /usr/local/ssl/lib/libcrypto.so /usr/lib/libcrypto.so.1.0.01
4.重新编译python3.7
make clean&&make&&make install
5.测试
pytho3
import ssl
如果不报错则安装正确
参考:
https://blog.csdn.net/jellocomeon/article/details/96913663
https://blog.csdn.net/yifeng20xx/article/details/74896426