Anaconda Python:如何安装缺少的依赖项?

Anaconda Python: How to install missing dependency?

我正在尝试从此处安装 graph-toolhttp://anaconda.org/vgauthier/graph-tool,使用该页面上提到的命令。

我使用了给定的命令行:

conda install -c http://conda.anaconda.org/vgauthier graph-tool

我收到以下错误:

Error: Could not find some dependencies for graph-tool: pixman

所以我尝试以类似的方式安装 pixmanhttp://anaconda.org/rwest/pixman

conda install -c http://conda.anaconda.org/rwest pixman

这成功了。

然而,在尝试安装 graph-tool 时,"could not find dependency" 错误仍然存​​在。为什么会发生这种情况,我该如何解决?没有我可以继续的其他错误消息。

Conda 需要能够一次找到所有依赖项。 -c 标志仅为该命令添加该通道。您需要 运行 conda install -c vgauthier rwest graph-tool。但更简单的方法是将这些频道添加到您的配置中

conda config --add channels vgauthier --add channels rwest

一旦你这样做了,你就可以 运行

conda install graph-tool 

它会从这些渠道抓取东西。

Anacona 2020.11

的依赖项存在冲突

设置 fedora-33 virtual machine with Anaconda (Version 2020.11) in April 2021, I got conflicting dependencies, as graph-tool was not compatible with python version 3.8.5. An pointed out here 时,方法是使用支持版本 python 的虚拟环境(3.7.9。在我的例子中,因为我还是 Anaconda 版本的新手2020.03).

在我的例子中,安装 Anaconda NOT as sudo 很重要。 否则一些 conda-alias 设置不正确(which conda 应该给出一个大约 30 行的命令和一些 if/else 条件)。

以下是 bash 命令:

$ cd ~/Downloads/
$ wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh
$ sudo chown -R user:user /opt/  # needed in my case to avoid sudo for installing Anaconda and calling conda later
$ bash Anaconda3-2020.11-Linux-x86_64.sh  # location: /opt/anaconda3, run conda init: yes
$ source ~/.bashrc  # make command conda available. Like restarting terminal in this case.
$ conda create -n envGraphTool anaconda python=3.7.9
$ conda activate envGraphTool
$ conda install -c conda-forge graph-tool

然后测试是否一切正常:

(envGraphTool) [user@f33 Downloads]$ which python
/opt/anaconda3/envs/envGraphTool/bin/python
(envGraphTool) [user@f33 Downloads]$ python -V
Python 3.7.9
(envGraphTool) [user@f33 Downloads]$ python
Python 3.7.9 (default, Aug 31 2020, 12:42:55) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import graph_tool as gt
>>> exit()
(envGraphTool) [user@f33 Downloads]$