首页 > 自考资讯 > 自考知识

conda 安装虚拟环境连接不上anaconda服务器解决

头条共创 2024-08-11

今天学习用conda安装新的虚拟环境,打算新建给虚拟环境练练手,查了命令conda create -n envname 就试着在CMD下运行conda create -n practice python=3.6 结果。。。

“CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/win-64/current_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.

If your current network has https://www.anaconda.com blocked, please file

a support request with your network engineering team.

'https://repo.anaconda.com/pkgs/main/win-64'

” 这么一大堆英文,凭我英文水平 得出结论是连接不上anaconda服务。手动输入地址https://repo.anaconda.com/pkgs/main/win-64/current_repodata.json 是可以的访问的,一头雾水,晚上查找各种资料发现 还有清华镜像地址一说。于是乎在网上找,试,终于找到了解决的办法,做个记录分享:

第一步:

C:\Users\administrator 目录下.condarc文件,用记事本打开 改成如下内容:

ssl_verify: true

show_channel_urls: true

channels:

- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/

- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/

没有多余行。是http,不是https,不过也可以试试,反正我是http才行

第二步:

在CMD中

conda config --add channels - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free

conda config --add channels - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

主要是将连接地址默认为清华镜像

第三步:

conda create -n practice python=3.6 。。。。OK

希望对需要的人有帮助

版权声明:本文转载于今日头条,版权归作者所有,如果侵权,请联系本站编辑删除

猜你喜欢