赞
踩
在安装TensorFlow输入conda create -n tensorflow python=3.5之后报错如下:
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pk
gs/r/win-64/repodata.json.bz2>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443
): Max retries exceeded with url: /pkgs/r/win-64/repodata.json.bz2 (Caused by SS
LError("Can\'t connect to HTTPS URL because the SSL module is not available."))'
))
查询网上各种资料,有说代理有问题,有说国内网络需要添加镜像。
添加了清华大学的镜像,在shell输入如下命令
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
但还是再报错
然后根据报错信息,单独执行了
wget https://repo.anaconda.com/pkgs/main/noarch/repodata.json.bz2
报错如下
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = C:\Program Files (x86)\GnuWin32/etc/wgetrc
--2019-11-06 10:00:02-- https://repo.anaconda.com/pkgs/main/noarch/repodata.jso
n.bz2
正在解析主机 repo.anaconda.com... 104.16.131.3, 104.16.130.3
Connecting to repo.anaconda.com|104.16.131.3|:443... 已连接。
ERROR: cannot verify repo.anaconda.com's certificate, issued by `/C=GB/ST=Greate
r Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secur
e Server CA 2':
Unable to locally verify the issuer's authority.
ERROR: certificate common name `ssl768542.cloudflaressl.com' doesn't match reque
sted host name `repo.anaconda.com'.
To connect to repo.anaconda.com insecurely, use `--no-check-certificate'.
无法建立 SSL 连接。
可以看出大致是目标网络证书不可用,可将https改为http(http的连接很简单,是无状态的;HTTPS协议是由SSL+HTTP协议构建的可进行加密传输、身份认证的网络协议,比http协议安全。)
而后重新输入
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
此配置也可以通过将C:\Users<本机用户名>.condarc文件直接修改
之后执行conda create -n tensorflow python=3.5就可以了,希望对大家有帮助
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。