我在执行brew install homebrew/science/igraph
时执行sudo pip3 install python-igraph
,得到以下错误
Cannot find the C core of igraph on this system using pkg-config.
We will now try to download and compile the C core from scratch.
Version number of the C core: 0.7.1.post6
We will also try: 0.7.1
Using temporary directory: /private/tmp/pip-build-35vcjf7l/python-igraph/tmp/igraph.4cz7yjcl
Downloading igraph-0.7.1.tar.gz... 0.28%error: <urlopen error retrieval incomplete: got only 992 out of 2967134 bytes>
有人能帮忙吗?非常感谢
发布于 2017-09-21 03:48:15
注意:这篇文章假设您已经安装了 自制 ,并且正在尝试在Mac.上安装。
为了避免python3 3/python3 2的任何问题,我建议使用python2,因为这正是python3库所设计的。我在mac上执行了以下代码,一切都很顺利。
在您的终端中,在python2上安装python2的说明执行以下几行:
brew install cairo
brew install py2cairo
brew install igraph
现在,这最后一行安装C核。最后一条终点线是:
sudo pip install python-igraph
上面的行为python2安装python2,注意这些行需要大约2分钟才能完成。
接下来,打开python2或空闲-从终端(我使用空闲)。
Mow检查python REPL外壳..。
import igraph.test
igraph.test.run_tests()
如果一切看起来都还好的话,那么你就可以在python中为你工作了
也请检查这个:
from igraph import *
g = Graph.Famous("petersen")
plot(g)
您应该会得到peterson图的一个很好的图形(红色节点,小图)。
https://stackoverflow.com/questions/45667147
复制相似问题