在 debian 上安装 Igraph 0.7 时出错

Erro when install Igraph 0.7 on debian

我尝试从以下位置安装 python-igraph:

pip install python-igraph

[https://github.com/igraph/python-igraph] python setup.py build

两者都报告了与此错误相同的错误:https://github.com/igraph/igraph/issues/468

在几次尝试失败后,我又遇到了另一个错误:

输入:sudo python setup.py buildsudo pip install python-igraph

输出:

/usr/local/lib/python2.7/dist-packages/setuptools-15.0-py2.7.egg/setuptools/dist.py:282: UserWarning: Normalizing '0.7.1-4' to '0.7.1.post4'
running install
running bdist_egg
running egg_info
creating python_igraph.egg-info
writing python_igraph.egg-info/PKG-INFO
writing top-level names to python_igraph.egg-info/top_level.txt
writing dependency_links to python_igraph.egg-info/dependency_links.txt
writing python_igraph.egg-info/PKG-INFO
writing top-level names to python_igraph.egg-info/top_level.txt
writing dependency_links to python_igraph.egg-info/dependency_links.txt
writing manifest file 'python_igraph.egg-info/SOURCES.txt'
reading manifest file 'python_igraph.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'python_igraph.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
Build type: dynamic extension
Include path: /usr/local/include/igraph
Library path: /usr/local/lib
Linked dynamic libraries: igraph
Linked static libraries: 
Extra compiler options: 
Extra linker options: 
building 'igraph._igraph' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/igraph -I../../build/include -I../../include -I/usr/local/include/igraph -I/usr/include/igraph -I/usr/include/python2.7 -c src/edgeobject.c -o build/temp.linux-x86_64-2.7/src/edgeobject.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/igraph -I../../build/include -I../../include -I/usr/local/include/igraph -I/usr/include/igraph -I/usr/include/python2.7 -c src/random.c -o build/temp.linux-x86_64-2.7/src/random.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/igraph -I../../build/include -I../../include -I/usr/local/include/igraph -I/usr/include/igraph -I/usr/include/python2.7 -c src/bfsiter.c -o build/temp.linux-x86_64-2.7/src/bfsiter.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/igraph -I../../build/include -I../../include -I/usr/local/include/igraph -I/usr/include/igraph -I/usr/include/python2.7 -c src/edgeseqobject.c -o build/temp.linux-x86_64-2.7/src/edgeseqobject.o
In file included from src/edgeseqobject.c:27:0:
src/convert.h:63:57: error: unknown type name ‘igraph_layout_grid_t’
src/convert.h:66:63: error: unknown type name ‘igraph_random_walk_stuck_t’
error: command 'gcc' failed with exit status 1

谁能帮帮我?

您在 /usr/local 中安装了 igraph 的 C 核心副本,但它与您尝试安装的 Python 接口版本不兼容。从输出来看,您正在安装 python-igraph 0.7.1-4,它与 igraph 0.7.1 兼容。因此,要么安装 igraph 的 C 核心版本 0.7.1,要么只是从 /usr/local/include/igraph/usr/local/lib 和可能的 /usr/local/lib/pkgconfig 中删除所有与 igraph 相关的东西,然后再试一次 pip install python-igraph。如果你从你的机器上删除了 C 核心,pip install python-igraph 将尝试下载它并在编译 Python 接口时 link 到它。