在ubuntu中使用conda创建虚拟环境,报网络错误

请问下面这个问题怎么解决?
起因:使用xshell中的ssh方式连接服务器,想创建一个虚拟环境conda create -n ddnm python=3.8,服务器用的校园网连接(学校的服务器只能用内网连接)
报错如下:
CondaHTTPError: HTTP 000 CONNECTION FAILED for url mirrors.tuna.tsinghua.edu.cn/anacon...
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.
‘http//mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64’
已经尝试的解决方法:
1.vim ~/.condarc增删过镜像,删过defaults,改过ssl_verify
2.可以ping通百度IP地址,ping百度域名不行不认识域名
3.使用sudo su获取管理员权限建虚拟环境conda create -n ddnm python=3.8
,报错如下CondaHTTPError: HTTP 000 CONNECTION FAILED for url repo.anaconda.com/pkgs/main/linux-...
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 www.anaconda.com blocked, please file
a support request with your network engineering team.

ConnectionError(MaxRetryError(“HTTPSConnectionPool(host=’repo.anaconda.com’, port=443): Max retries exceeded with url: /pkgs/main/linux-32/repodata.json.bz2 (Caused by NewConnectionError(‘<urllib3.connection.VerifiedHTTPSConnection object at 0xf577506c>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution’))”))

讨论数量: 1

这看起来像是连接Anaconda仓库失败的问题。这可能是由于网络问题,或者是你的服务器无法解析镜像站的域名。

要不先确认下网络连接。学校的服务器上可能会存在一些网络限制。你可以联系下网络管理员,看看是否存在对Anaconda仓库的访问限制。

还有就是检查DNS设置。你提到你可以ping通百度的IP地址,但是不能解析百度的域名。这可能意味着你的DNS设置有问题,可以尝试更改你的DNS设置,例如使用8.8.8.8或8.8.4.4。

1年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!