问题描述:
conda create -n test
CondaHTTPError: HTTP 404 NOT FOUND for url <http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/pip-21.2.2-py36h06a4308_0.tar.bz2>
Elapsed: 00:00.044844
创建新环境时报错:
即使是使用清华源官网提供的.condarc配置仍然出现上述报错。
清华源官网:anaconda | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
官网示例配置:
channels:
- defaults
show_channel_urls: true
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
原因暂且不明,大概猜测是官方配置的源未能完全覆盖创建环境所需要的包。
但是在一番搜寻下在这篇博客记录问题解决:anaconda创建环境失败-CSDN博客中找到了解决方案:修改.condarc文件中的内容即可完成镜像配置。
解决方案:
修改.condarc文件中的内容和下面相同:
# 查看当前使用的conda的配置信息
conda info
# 字段user config file中有.condarc的路径
# 修改.condarc中的内容
vim /你的路径/.condarc
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
ssl_verify: true
show_channel_urls: true