anaconda安装pytorch报错:(Caused by SSLError(“Can‘t connect to HTTPS URL because the SSL module is not av

anaconda安装pytorch报错:

CondaSSLError: OpenSSL appears to be unavailable on this machine. OpenSSL is required to
download and install packages.

Exception: HTTPSConnectionPool(host=‘conda.anaconda.org’, port=443): Max retries exceeded with url: /pytorch/win-64/current_repodata.json (Caused by SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”))
anaconda安装pytorch报错:(Caused by SSLError(“Can‘t connect to HTTPS URL because the SSL module is not av_第1张图片

解决办法:

设置清华镜像

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes

若需换回默认官网镜像源

conda config --remove-key channels

设置环境变量

增加几个anaconda路径,在系统变量path加入 anaconda路径 为

D:\anaconda3
D:\anaconda3\Scripts
D:\anaconda3\Library\bin

D:\anaconda3 为 anaconda 安装路径

ddl查找错误

参考:https://github.com/conda/conda/issues/8273

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

根据提示复制两个dll到指定目录。
D:\Anaconda\Library\bin -> D:\Anaconda\DLLs
anaconda安装pytorch报错:(Caused by SSLError(“Can‘t connect to HTTPS URL because the SSL module is not av_第2张图片
复制之后即可解决问题。如果不行的话,可能就是别的错误了。

你可能感兴趣的:(pytorch,https,ssl)