报错解决:Collecting package metadata current_repodata.json
- 1. 问题说明
- 2. 解决方法
1. 问题说明
今天在Win10用conda安装loris包的时候遇到了这个问题。在我打开了clash(FQ)时,显示的错误信息如下:
Collecting package metadata (current_repodata.json): failed
CondaSSLError: Encountered an SSL error. Most likely a certificate verification issue.
这个错误的意思是 conda 无法从镜像源下载或解析包的元数据文件,也就是 current_repodata.json 文件。这个文件包含了包的名称、版本、依赖等信息,是 conda 解决环境的重要依据。找了下教程总结了下,主要有以下几种原因:
- 网络连接不稳定或者被阻断,导致 conda 无法访问镜像源;
- 镜像源有问题或者过期,导致 conda 无法获取或解析 current_repodata.json 文件;
- conda 版本过旧,导致 conda 无法处理 current_repodata.json 文件的格式。
2. 解决方法
- 第1种: VPN 调回国内模式或者直接关闭。可能还需要重启下terminal命令行终端;
- 第2种: 可能是源太多了,可以选择删除一部分源,或者全部源:
-
- 删除所有源
conda config --remove-key channels
-
- 删除部分源:
conda config --remove channels <url> # 删除旧镜像源
- 第3种:
可能是conda里面确实没有这个包,比如我需要安装的loris这个包,最后弹出来这个,那就应该是没有:
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- loris
Current channels:
- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/win-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.