centos6 安装python3.7相关问题

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)/includeI(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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值