Anaconde 安装 - Can‘t connect to HTTPS URL because the SSL module is not available

问题描述

起因是在使用requests包访问https请求时,出现了SSLError,提示Caused by SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”
Anaconde 安装 - Can‘t connect to HTTPS URL because the SSL module is not available
根据一些博客设置verify=False,依然无效。
Anaconde 安装 - Can‘t connect to HTTPS URL because the SSL module is not available
在尝试通过pip指定安装缺少的包时,也出现了类似的提示。

通过pip install 命令安装包时,出现了

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)’: /simple/ssl/
Anaconde 安装 - Can‘t connect to HTTPS URL because the SSL module is not available
或者对于已安装的版本,提示WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Anaconde 安装 - Can‘t connect to HTTPS URL because the SSL module is not available
有些博客通过使用pip3.x指令(如我安装的是3.8.6版本的python,因此使用pip3.8)执行安装,没起作用。

解决方案

原文地址 https://github.com/conda/conda/issues/8273
Anaconde 安装 - Can‘t connect to HTTPS URL because the SSL module is not available

大意是:conda找错了openssl的地址,conda在 Anaconda3/library/bin目录下寻找dll,但实际上需要的dll在Anaconda3/bin目录下。因此只需要将这两个文件复制到Anaconda3/bin下即可。

根据提示复制两个dll到指定目录。
Anaconde 安装 - Can‘t connect to HTTPS URL because the SSL module is not available
不再报错
Anaconde 安装 - Can‘t connect to HTTPS URL because the SSL module is not available
同时pip也恢复正常。
Anaconde 安装 - Can‘t connect to HTTPS URL because the SSL module is not available
最后,gihub NB!