如何解决Conda 搜索找不到可以在 conda cloud 上找到的包
例如,我可以在 anaconda cloud 上找到 gxx_linux-64
,但是当我使用 conda search
搜索它时:
conda search -c conda-forge gxx_linux-64
它告诉我
Loading channels: done
No match found for: gxx_linux-64. Search: *gxx_linux-64*
PackagesNotFoundError: The following packages are not available from current channels:
- gxx_linux-64
Current channels:
- https://conda.anaconda.org/conda-forge/osx-64
- https://conda.anaconda.org/conda-forge/noarch
- https://repo.anaconda.com/pkgs/main/osx-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/osx-64
- https://repo.anaconda.com/pkgs/r/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.
解决方法
Conda 将搜索限制为 noarch
和特定于平台的频道子目录。在这种情况下,频道信息表明搜索是在 osx-64 平台上运行的,而包显然是 linux-64 构建,因此为什么不是找到了。
可以通过包含频道规范来专门搜索其他子目录。也就是说,无论从哪个平台搜索,都应该使用
conda search -c conda-forge/linux-64 gxx_linux-64
或者,使用完整的 MatchSpec 语法
conda search conda-forge::gxx_linux-64[subdir=“linux-64”]
但是,请注意,此软件包与 osx-64 不兼容。