CondaHTTPError: HTTP 000 CONNECTION FAILED for url
问题描述:
刚开始安装pytorch总是不成功,发现一直出现如下问题:
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/noarch/repodata.json
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.
ConnectionError(MaxRetryError(“HTTPSConnectionPool(host=‘mirrors.tuna.tsinghua.edu.cn’,
port=443): Max retries exceeded with url:
/anaconda/cloud/msys2/noarch/repodata.json (Caused by
NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object
at 0x7fe41c681358>: Failed to establish a new connection: [Errno -3]
Temporary failure in name resolution’))”))
刚开始以为设置conda源的问题,改了几遍都不行,怀疑是网络设置问题。
然后ping了正常网络,果然不行。
然后进入DNS设置发现里面进入啥都没有,怪不得找不到。于是设置一下DNS就解决问题了。
操作如下:
#编辑resolv.conf
$ sudo vi /etc/resolv.conf
添加内容容下:
nameserver 127.0.1.1
#这里用的是阿里云的DNS服务器
nameserver 223.5.5.5
nameserver 223.6.6.6
解决问题
推荐阅读
-
使用nginx代理gogs遇到推送代码错误的问题(RPC failed; HTTP 413 curl 22 The requested URL returned error: 413)
-
使用nginx代理gogs遇到推送代码错误的问题(RPC failed; HTTP 413 curl 22 The requested URL returned error: 413)
-
anaconda下载包时网络连接错误(CondaHTTPError:HTTP 000 connection failed for url)
-
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
-
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
-
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
-
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
-
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
-
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
-
error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500 Internal Server Error