目录
3、EBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443的解决方法
一、镜像源设置
1、查看当前的下载源(初始)
conda config --show
直接查看设置的镜像:
conda config --show channels
2、修改国内源
这里有三组国内源可供选择:
# 清华镜像:
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
# 中科大镜像:
https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
# 上海交大镜像:
https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/main/
https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/free/
修改方法,以清华镜像为例:
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 --set show_channel_urls yes
注意,有人说不能有 s
将 - https://… 改成 - http://…
然后再次运行conda config --show
可以看到channels内容已经更改
注意:如果当上面的找不到这个包时,我们可以设置从conda-forge里找,即在上面镜像找不到时生效。一般不设置,设置了反而不容易发现是从哪里下载的。
conda config --append channels conda-forge
二、附录
1、还原默认源
conda config --remove-key channels
2、移除指定源
conda config --remove-key channels XXX移除指定的链接 # 如果出错,可写成conda config --remove channels XXX
3、EBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443的解决方法
遇到这样的问题,网络请求和solving environment都是连接不成功的。后来上网查了一圈发现,是因为[conda-build]这个包有问题。
conda-build与其他包的主要区别在于它的用途。conda-build主要是用来构建和打包Python以及其他语言的包,它允许你定义依赖关系,并在一个自动化的过程中进行构建和测试。当他出现了问题之后,就会报EBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443等等问题,拼命的DEBUG,DEBUG,DEBUG。
升级conda-build版本:
conda install -c conda-forge conda-build
或者退回3.25.0版本:
conda install conda-build=3.25.0
好像不是3.26.0即可:
conda install "conda-build!=3.26.0"
4、可以指定网址安装
conda install cudnn=8.4.1 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/