问题描述
在Anaconda Prompt(Anaconda)中输入:conda create -n yolov5 python=3.8后报如下错误:
原因分析
通过问题描述可以看出错误原因是HTTP错误,所以我们可以通过更改镜像源的方式来解决此问题。
解决方案
1、配置/更改镜像源
Step1:输入以下命令查看当前channels的信息,如果只有defaults执行Step2,如果还有其他镜像源需要先执行Step3再执行Step2:
conda config --show channels
Step2:复制以下命令一次性粘贴执行:
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 config --set show_channel_urls yes
Step3:如果之前配置过镜像源,但是现在不能用了,需要使用如下命令移除之前的镜像源,再执行Step2:
conda config --remove-key channels
(4)现在再次输入conda create -n yolov5 python=3.8,问题完美解决★,°:.☆( ̄▽ ̄)/$:.°★ 。
2、以下是其他解决此问题的方法,但是我没尝试过,如果大家通过配置/更改镜像源的方式没有成功,可以尝试以下方法:
conda报错-Collecting package metadata (current_repodata.json): failed