使用Anaconda报错:Collecting package metadata (repodata.json): failed离谱解决方案!!!
**一、问题描述:**在命令行窗口执行conda create -n test3 python=3.12命令时报错
报错信息如下所示: Channels: - defaults Platform: win-64 Collecting package metadata (repodata.json): failed UnavailableInvalidChannel: HTTP 403 FORBIDDEN for channel pkgs/main <https://repo.anaconda.com/pkgs/main> The channel is not accessible or is invalid. You will need to adjust your conda configuration to proceed. Use `conda config --show channels` to view your configuration's current state, and use `conda config --show-sources` to view config file locations.
**二、最终解决方案**
先说结论:换个网络连接就好了哈哈
**三、尝试过的解决方案**
3.1、把路径“Anaconda3/Library/bin ”如下两个文件复制到“Anaconda3/DLLs”:
libcrypto-3-x64.dll
libssl-3-x64.dll
3.2、 运行conda clean -i 清除缓存等
3.3、 找到C:\用户名\.condarc 这个文件,如果没有,试试自行创建,运行
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --show -sources3.4、 编辑.condarc这个文件,拷贝如下内容并覆盖原本的内容:
channels: - defaults show_channel_urls: true channel_alias: http://mirrors.tuna.tsinghua.edu.cn/anaconda default_channels: - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2 custom_channels: conda-forge: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud msys2: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud bioconda: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud menpo: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud pytorch: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud simpleitk: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud(温馨提示:记得点保存后再退出文件)
3.5. 在运行conda update命令试试看,会看到
3.5.1如果报如下信息则表示已解决:
Collecting package metadata (current_repodata.json): done Solving environment: |3.5.2如果报以下信息则表示未解决:
CondaValueError: no package names supplied # Example: conda update -n myenv scipy四、关闭VPN连接
如以上措施都未解决,可尝试把VPN连接关掉
五、参考博客
【综合解决方案】Anaconda: Collecting package metadata (current_repodata.json): failed_collecting package metadata (repodata.json): faile-CSDN博客
