centos6.8解决pip3下载包遇到的错误“can‘t connect to HTTPS URL because the SSL module is not available”

张开发
2026/4/3 9:30:50 15 分钟阅读
centos6.8解决pip3下载包遇到的错误“can‘t connect to HTTPS URL because the SSL module is not available”
1问题根源centos6.8中默认自带的python为2.6版本我本地通过源码编译安装Python3.7后顺带安排了pip3由于centos3.7源码编译安装未配置好openssl导致pip3下载包的提示“cant connect to HTTPS URL because the SSL module is not available”2问题修复2.1下载高版本ssl安装下载openssl-1.0.2j.tar.gz版本进行源码编译安装#cd /opt #tar -zxvf openssl-1.0.2j.tar.gz #cd openssl-1.0.2j #./config --prefix/opt/openssl102 #make make install #ln -sv /opt/openssl102/openssl /usr/bin/openssl2.2源码安装python3.7解压python3.7源码文件#cd /opt #tar -Jxvf Python-3.7.2.tar.xz修改配置#cd /opt/Python-3.7.2 #vi Modules/Setup.dist把图中这几行注释取消掉并根据自身SSL路径修改配置例如我自己更改为SSL/opt/openssl102源码安装Python3.7#cd /opt/Python-3.7.2 #./configure --prefix/opt/python372.2修改配置修改为配置后进行pip下载包发现包下载无问题了#ln -sv /usr/bin/python3 /usr/bin/python #ln -sv /usr/bin/pip3 /usr/bin/pip #pip install requests

更多文章