anaconda 更换国内镜像源后下载出错

来源:互联网 发布:艾瑞数据查询 编辑:程序博客网 时间:2024/06/06 12:55

错误信息:

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/pkgs/free/linux-64/repodata.json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7faf1f116310>: Failed to establish a new connection: [Errno 101] Network is unreachable',))",),)


解决方法:

首先确定更换的国内源可以用浏览器访问,

镜像源目前好像只有中科大https://mirrors.ustc.edu.cn/anaconda/pkgs/free/和清华两个

cd 

sudo gedit .condarc

删除 - default 所在的行

.condarc的内容应该是

channels:
  - http://mirrors.ustc.edu.cn/anaconda/pkgs/free/
show_channel_urls: true


之后就可以使用conda下载了