安装libigraph0-dev后无法安装python-igraph

时间:2015-08-10 16:01:19

标签: python igraph

我已经阅读了一些关于安装python-igraph的其他帖子,但我仍然无法完成任务。

我首先安装了libigraph0-dev,但这只改变了我的错误的性质并没有修复它。我甚至无法粘贴整个日志,因为它的字符太多,但这是日志的一部分。

日志的第一部分有一些错误

Downloading/unpacking python-igraph
  Downloading python-igraph-0.7.1.post6.tar.gz (377kB): 377kB downloaded
  Running setup.py egg_info for package python-igraph

Installing collected packages: python-igraph
  Running setup.py install for python-igraph
    Build type: dynamic extension
    Include path:
    Library path:
    Runtime library path:
    Linked dynamic libraries: igraph
    Linked static libraries:
    Extra compiler options:
    Extra linker options:
    building 'igraph._igraph' extension
    gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python2.7 -c src/attributes.c -o build/temp.linux-x86_64-2.7/src/attributes.o
    In file included from src/attributes.c:24:
    src/attributes.h:27:31: error: igraph_attributes.h: No such file or directory
    src/attributes.h:28:29: error: igraph_datatype.h: No such file or directory
    src/attributes.h:29:30: error: igraph_iterators.h: No such file or directory
    src/attributes.h:30:30: error: igraph_strvector.h: No such file or directory
    src/attributes.h:31:27: error: igraph_vector.h: No such file or directory
    In file included from src/attributes.c:24:
    src/attributes.h:46: warning: type defaults to 'int' in declaration of 'igraph_t'
    src/attributes.h:46: error: expected ';', ',' or ')' before '*' token
    src/attributes.h:50: warning: type defaults to 'int' in declaration of 'igraph_t'
    src/attributes.h:50: error: expected ';', ',' or ')' before '*' token
    src/attributes.h:52: warning: type defaults to 'int' in declaration of 'igraph_t'
    src/attributes.h:52: error: expected ';', ',' or ')' before '*' token
    src/attributes.h:56: warning: type defaults to 'int' in declaration of 'igraph_t'
    src/attributes.h:56: error: expected ';', ',' or ')' before '*' token

日志结束

src/attributes.c:1730: warning: type defaults to 'int' in declaration of 'igraph_t'

src/attributes.c:1730: error: expected ';', ',' or ')' before '*' token

src/attributes.c:1782: warning: type defaults to 'int' in declaration of 'igraph_t'

src/attributes.c:1782: error: expected ';', ',' or ')' before '*' token

src/attributes.c:1817: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'igraphmodule_attribute_table'

src/attributes.c: In function 'igraphmodule_initialize_attribute_handler':

src/attributes.c:1842: warning: implicit declaration of function 'igraph_i_set_attribute_table'

src/attributes.c:1842: error: 'igraphmodule_attribute_table' undeclared (first use in this function)

error: command 'gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/local/bin/python -c "import setuptools;__file__='/tmp/pip_build_root/python-igraph/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-T3WW8S-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip_build_root/python-igraph

任何人都知道如何解决这个问题?

1 个答案:

答案 0 :(得分:3)

下载与python-igraph的版本号匹配的libigraph0-dev版本并尝试编译它。现在您正在下载python-igraph 0.7.1.post6,它应该链接到igraph 0.7.1,但您的计算机上有libigraph0(和libigraph0-dev)的旧版本。

如果您不需要libigraph0其他任何内容,则可以删除libigraph0libigraph0-dev,然后尝试再次从pip安装python-igraph。这样python-igraph会检测到C core没有安装,因此会自动下载正确版本的C core并链接到它。