【问题标题】:Error while installing python-igraph on Ubuntu 16.04在 Ubuntu 16.04 上安装 python-igraph 时出错
【发布时间】:2017-05-12 15:36:36
【问题描述】:

我尝试使用pip install 安装python-igraph,但在导入时收到错误消息:

:~$ pip install python-igraph
Collecting python-igraph
Installing collected packages: python-igraph
Successfully installed python-igraph-0.7.1.post6
:~$ python
Python 2.7.12 |Anaconda 4.2.0 (64-bit)| (default, Jul  2 2016, 17:42:40) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import igraph
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/anaconda2/lib/python2.7/site-packages/igraph/__init__.py", line 34, in <module>
    from igraph._igraph import *
ImportError: /home/user/anaconda2/lib/python2.7/site-packages/igraph/_igraph.so: undefined symbol: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1Ev

然后我尝试通过anaconda进行安装,也导致报错:

    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/home/user/anaconda2/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-65xDUp/python-igraph/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-LIJjEG-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-65xDUp/python-igraph/

完整的错误信息在这里 - link。上次我在 Ubuntu 上安装 igraph 时没有这样的问题。有谁遇到过这个问题,知道怎么解决吗?

【问题讨论】:

  • 第二个错误仅显示最后几行 - 查看其余行并搜索是否有关于 python.h 或其他 .h 文件的内容 - 它接缝找不到一些文件来编译它。
  • 我找到了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.,然后找到了Could not download and compile the C core of igraph.。可能是什么原因?
  • 你必须显示所有行。它试图编译 C 代码,但它有问题。大多数情况下,它需要文件 *.h 中的一些 C 头文件,因此您必须安装一些库 - 但它会影响您在错误消息中的内容。
  • 这里是完整的错误信息 - dpaste.com/29EVF25
  • 我在我的 Linux Mint 上进行了尝试,但遇到了同样的错误 - 它无法下载 C 源代码。我试过apt search igrahp 并且有libigraph0libigraph-dev(文件*.h)所以我安装了apt install libigraph-dev 但它安装了旧版本0.6.5 和pip 有不同的问题 - 它无法编译,因为它使用不同的代码。所以你必须手动下载igraph 或者等到他们删除那个错误。

标签: python ubuntu pip anaconda igraph


【解决方案1】:

遇到同样的问题。但是 pip install 更冗长:

curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "igraph"
Download failed: http://igraph.org/nightly/get/c/igraph-0.7.1.tar.gz

好像http://igraph.org/nightly 无法访问。

【讨论】:

    猜你喜欢
    • 2016-12-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-16
    相关资源
    最近更新 更多