conda镜像源管理

在使用conda下载包时出现了些问题:说当前通道缺少包。我便想是不是镜像源的问题,记录一下常见的镜像源管理命令:

查看已有的镜像源:

conda config --show-sources 

添加镜像源:

conda config --add channels #后接镜像源 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mai

删除镜像源:

conda config --remove channels #后接镜像源
conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mai

命令没有错,但我在这里出了问题:

Fetching package metadata ...
CondaHTTPError: HTTP 000 CONNECTION FAILED for url 
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.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'mirrors.bfsu.edu.cn\', port=443): Max retries exceeded with url: /anaconda/pkgs/main/win-64/repodata.json (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'ssl3_get_server_certificate\', \'certificate verify failed\')],)",),))',),)

解决方案:

删掉报错的镜像源,将添加的清华源地址中的https改为http,添加清华源如下:

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes

再运行就成功啦!

你可能感兴趣的:(conda,python,深度学习)