Anaconda创建新的环境一直报错

时间:2024-07-18 07:09:13

Anaconda创建新的环境一直报错

报错信息如下:

CondaHTTPError: HTTP 404 NOT FOUND for url <https://pypi.tuna.tsinghua.edu.cn/simple/noarch/repodata.json>
Elapsed: 00:01.358961

The remote server could not find the noarch directory for the
requested channel with url: https://pypi.tuna.tsinghua.edu.cn/simple

As of conda 4.3, a valid channel must contain a `noarch/repodata.json` and
associated `noarch/repodata.json.bz2` file, even if `noarch/repodata.json` is
empty. please request that the channel administrator create
`noarch/repodata.json` and associated `noarch/repodata.json.bz2` files.
$ mkdir noarch
$ echo '{}' > noarch/repodata.json
$ bzip2 -k noarch/repodata.json

解决办法:镜像是http开头,不要写https

在这里插入图片描述

  • 查看所有的镜像信息
conda config --show-sources
  • 删除镜像
conda config --remove channels 镜像的网址
  • 添加镜像
# 添加新镜像源
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