(Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

重装系统,安装python3.7.5之后,使用pip3 install ipython时出现了报错信息: Can‘t connect to HTTPS URL because the SSL module is not available

1、cd 到Python-3.7.5目录下,重新编译安装

cd Python-3.7.5
./configure --prefix=/usr/local/python3.7.5 

2、查看自己的openssl的版本,并升级一下

[root@CentOS7 Python-3.7.5]# openssl version
[root@CentOS7 Python-3.7.5]# mv /usr/bin/openssl /usr/bin/openssl.bak
[root@CentOS7 Python-3.7.5]# ln -sf /usr/local/openssl/bin/openssl /usr/bin/openssl
[root@CentOS7 Python-3.7.5]# echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
[root@CentOS7 Python-3.7.5]# ldconfig -v   
[root@CentOS7 Python-3.7.5]# openssl version
OpenSSL 1.1.1a  20 Nov 2018

查看openssl的安装目录,我这里是/usr/local/openssl

[root@CentOS7 Python-3.7.5]# whereis openssl
openssl: /usr/bin/openssl /usr/lib64/openssl /usr/include/openssl /usr/local/openssl /usr/share/man/man1/openssl.1ssl.gz

3、编译完成后先不要make,先修改Python源码包中ssl的参数,
打开源码解压目录中的 Modules/Setup ,
直接搜索 SSL= ,将SSL=后面的目录改为前面openssl的安装目录,并把下面三行的注释去掉。

[root@CentOS7 Python-3.7.5]# vim Modules/Setup
SSL=/usr/local/openssl
#_ssl _ssl.c #    -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl #    -L$(SSL)/lib -lssl -lcrypto

4、改完之后就在解压目录直接make就行了。

[root@CentOS7 Python-3.7.5] 
[root@CentOS7 Python-3.7.5]# echo "export PATH=/usr/local/python3.7.5/bin:$PATH" >> ~/.bashrc
[root@CentOS7 Python-3.7.5]# source ~/.bashrc
[root@CentOS7 Python-3.7.5]# pip3 list
Package    Version
---------- -------
pip        19.2.3 
setuptools 41.2.0 
WARNING: You are using pip version 19.2.3, however version 21.0.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip‘ command.

5、安装你想要的东西 pip3 install ipython

ojbk!!!

借鉴:
https://www.cnblogs.com/itbsl/p/11275728.html
https://www.jb51.net/article/166688.htm

(Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

上一篇:邮箱(outlook)嵌入html页面


下一篇:网络安全测试基础环境phpStudy的搭建