如果在用conda安装包时出现:
Loading channels: failed
CondaHTTPError: HTTP 404 NOT FOUND for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch/repodata.json>
Elapsed: 00:00.084698
The remote server could not find the noarch directory for the
requested channel with url: https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
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
You will need to adjust your conda configuration to proceed.
Use `conda config --show channels` to view your configuration's current state.
Further configuration help can be found at <https://conda.io/docs/config.html>.
这是因为
/help/anaconda/
给了通知:
“根据 Anaconda 软件源上的说明,Anaconda 和 Miniconda 是 Anaconda, Inc. 的商标,任何未经授权的公开镜像都是不允许的。去年我们曾尝试与公司有关人员联系,但未能取得授权。
在没有上游授权的情况下,我们无法保证镜像的合法性与服务质量。因此我们决定,在取得授权之前无限期停止 Anaconda 镜像服务。即日起,我们将停止 Anaconda 的更新并隐藏镜像入口链接。一个月后,彻底关闭 Anaconda 镜像的文件下载。请现有用户尽快切换至官方下载地址,以免影响正常使用。
感谢您的理解与支持!
Update 1 on 2019-05-16: 上述镜像已经被移除”
也就是说,今天开始必须恢复官方源了
使用以下语句可以恢复到默认源。
conda config --remove-key channels