Ubuntu 16.04 上的 python igraph 导入错误

标签 python igraph importerror ubuntu-16.04

我最近将 Ubuntu 从 14.04 升级到 16.04,并且在使用 python igraph(在 anaconda 上)时遇到了奇怪的问题。我在 14.04 中没有遇到任何问题。

具体来说 - pip install python-igraph 似乎有效:

Collecting python-igraph
Installing collected packages: python-igraph
Successfully installed python-igraph-0.7.1.post6

但是,尝试导入 igraph(在 Python 2.7.12 |Anaconda 4.2.0(64 位)上的 ipython 中)我得到以下信息:

ImportError                               Traceback (most recent call last)
<ipython-input-3-8e950eb5d8d8> in <module>()
----> 1 import igraph

/home/scifric/anaconda2/lib/python2.7/site-packages/igraph/__init__.py in <module>()
     32 # pylint: disable-msg=W0401
     33 # W0401: wildcard import
---> 34 from igraph._igraph import *
     35 from igraph._igraph import __version__, __build_date__
     36 from igraph.clustering import *

ImportError: /home/scifric/anaconda2/lib/python2.7/site-       ackages/igraph/_igraph.so: undefined symbol: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1Ev

我在 Linux Arch 或 OSX 上看到了一些有类似问题的线程,但似乎没有一个解决方案适合。 知道缺少什么吗?

谢谢!

最佳答案

在安装/重新安装/卸载/重新编译 python igraph 和 c 核心库后,结果令人沮丧,以下是有效的: 我用 pip 和 conda 卸载了 python-igraph 在从根搜索所有跟踪后,我删除了所有 igraph 目录(cd/然后 sudo find -name igraph)。 现在,这就是感谢 Tamás Nepusz ( @ntamas ) 的神奇之处: 只需安装 Anaconda Python 的预编译二进制包即可:

conda install -c marufr python-igraph=0.7.1.post6

取自这里:https://anaconda.org/marufr/python-igraph

就这么简单。 (但我仍然对我之前经历过的python igraph和c库之间的冲突感到困惑。至少我没有让它工作)。

关于Ubuntu 16.04 上的 python igraph 导入错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41092352/

相关文章:

Golang 导入包

python - 如何正确计算下列方程?

python - Django 重组石斑鱼

python - 请问真正的path.py 能站起来吗?

python - 无法使用 python-igraph,安装后没有可用的方法或属性(Ubuntu 14.04。)

r - 在 R(iGraph 等)中进行聚类后,您可以维护集群中的节点+边来进行单独的集群分析吗?

python - 如何使用应用于 LSTM 的注意力包装器的输出作为 TimeDistributed 层 Keras 的输入?

r - 如何比较两个连续图中的社区

java - 错误: cannot find symbol - when new class is added tand imported in an existing gradle project in IntelliJ IDEA

SAS proc 导入错误 : "Didn' t see end for |varnames| element. 得到 -> ||"