使用conda创建环境以及出现包找不到解决方案

安装requirement.txt文件依赖

pip install -r requirements.txt

除了使用pip命令来生成及安装requirement.txt文件以外,也可以使用conda命令来安装。

conda install --yes --file requirements.txt

当你使用conda进行安装的时候经常出现以下错误:PackagesNotFoundError: The following packages are not available from current channels

Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.


PackagesNotFoundError: The following packages are not available from current channels:

  - igraph

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.

你需要去https://anaconda.org 这个网址,在上方的搜索条上搜索你要安装这个包的其他channel,下边展示一下如何找igraph的其他channel
首先进入上述网址,我这里搜索igraph,会出现所有包名中包含“igraph”字段的包:

点击想要的加粗绿色包名就可以查找详细信息

接着在你的命令行窗口或Anaconda Prompt窗口对应的路径下运行页面中提供的任意一条命令即可。
运行任意一条命令

PackagesNotFoundError: The following packages are not available from current channels的解决办法_正在学习的黄老师的博客-CSDN博客

猜你喜欢

转载自blog.csdn.net/weixin_43135178/article/details/123773155
今日推荐