在使用 Conda 安装包时,经常会遇到 'PackagesNotFoundError' 错误,提示无法找到所需的包,例如:

conda install requirement
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:

  - requirement

Current channels:

  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/win-64
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/win-64
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/noarch
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/win-64
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/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.


PS D:\AllCodeResp\RustResp\winkiller>

解决方法

可以尝试添加新的 conda channels 来解决该问题。可以通过以下命令添加 conda-forge 和 anaconda channels:

conda config --add channels conda-forge
conda config --add channels anaconda

然后重新运行你的安装命令即可。如果还是无法找到所需的包,可以搜索其他可用的 channels 来查找所需的包。

Conda 安装包失败:PackagesNotFoundError:  'requirement'  不可用

原文地址: https://www.cveoy.top/t/topic/lyPQ 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录