如何确定安装conda软件包需要启用的通道?

2024-04-16 06:45:39 发布

您现在位置:Python中文网/ 问答频道 /正文

例如,假设我想安装bioconda包gapfiller

conda new -n gapfiller -c bioconda -c conda-forge gapfiller

如果运行上述命令,则会出现以下错误:

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

  - boost[version='>=1.57.0,<1.57.1.0a0']

Current channels:

  - https://conda.anaconda.org/bioconda/linux-64
  - https://conda.anaconda.org/bioconda/noarch
  - https://conda.anaconda.org/conda-forge/linux-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch

在这一点上,我应该采取什么下一步来确定我需要开始包括哪个频道

我试过查看^{} for the package,但它只列出了gapfiller所依赖的,而不是它们可以在其中找到的通道。我也尝试过conda search boost,但当然,在我当前的频道中只返回(不兼容)结果,它没有告诉我如何找到新频道:

$ conda search boost
Loading channels: done
# Name                       Version           Build  Channel             
boost                         1.65.1          py27_4  pkgs/main           
boost                         1.65.1  py27h0eb07c9_3  pkgs/main           
boost                         1.65.1          py35_4  pkgs/main           
boost                         1.65.1  py35heb9229b_3  pkgs/main           
boost                         1.65.1          py36_4  pkgs/main           
boost                         1.65.1  py36hfaba7b9_3  pkgs/main           
boost                         1.67.0          py27_4  pkgs/main           
boost                         1.67.0          py35_4  pkgs/main           
boost                         1.67.0          py36_4  pkgs/main           
boost                         1.67.0          py37_4  pkgs/main           
boost                         1.71.0          py38_0  pkgs/main 

如何确定用于解决PackagesNotFoundError问题的正确通道


Tags: httpsorgcommainlinuxrepoanacondaconda
1条回答
网友
1楼 · 发布于 2024-04-16 06:45:39

通常,当涉及到旧的包版本时,它们被降级到the free channel which was taken off the defaults metachannel last year。有几种方法可以将其添加回(例如,配置设置restore_free_channel或环境变量CONDA_RESTORE_FREE_CHANNEL),但简单的即席解决方案是将其作为一个通道包括在内:

conda install -c free ...

对于linux-64平台上的boost=1.57,我明白了

conda search -c free boost=1.57[subdir='linux-64']
Loading channels: done
# Name                       Version           Build  Channel             
boost                         1.57.0               0  free                
boost                         1.57.0               1  free                
boost                         1.57.0               4  free   

相关问题 更多 >