Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")解决方法

前言

前段时间在 centos 上安装好 python3.7 后,通过 pip 安装模块时,出现以下错误:Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")

1.处理 openssl

yum install openssl
mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/bin/openssl /usr/include/bin/openssl.bak
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/bin/openssl /usr/include/bin/openssl

2.重新安装编译 python

按照自己前面安装和编译 python 的步骤进行重装就解决了这个问题。下面只是我的安装步骤,仅供参考

./configure --prefix=/usr/local/python3
make
make install
Last modification:August 22nd, 2019 at 06:29 pm
如果觉得我的文章对你有用,请随意赞赏

Leave a Comment

召唤看板娘