简体   繁体   English

在Ubuntu 16.04上的python igraph导入错误

[英]python igraph import error on Ubuntu 16.04

I recently upgraded Ubuntu from 14.04 to 16.04 and I have strange issues with using python igraph (on anaconda). 我最近将Ubuntu从14.04升级到16.04,我在使用python igraph(在anaconda上)时遇到了奇怪的问题。 I didn't have any issues in the 14.04. 我在14.04没有任何问题。

Specifically - pip install python-igraph seems to work: 具体来说 - pip install python-igraph似乎有效:

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

However,trying to import igraph (in ipython on Python 2.7.12 |Anaconda 4.2.0 (64-bit) I get the following: 但是,尝试导入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

I saw some threads with similar problems on Linux Arch or OSX and none of the solutions seem to fit. 我在Linux Arch或OSX上看到了一些类似问题的线程,但似乎没有一个解决方案适合。 Any idea what is missing? 知道缺少什么吗?

Thanks! 谢谢!

After installing/reinstalling/uninstalling/recompiling of the python igraph and the c core libraries yielding frustrations, here is what worked: I uninstalled python-igraph both with pip and conda I deleted ALL igraph directories after searching for all traces from root (cd / then sudo find -name igraph ). 在安装/重新安装/卸载/重新编译python igraph和c核心库产生挫折之后,这是有效的:我用pip和conda卸载了python-igraph我在从root搜索所有跟踪后删除了所有igraph目录(cd /然后sudo找-name igraph )。 Now here is the magic thanks to Tamás Nepusz ( @ntamas ): Simply install the precompiled binary package for Anaconda Python: 现在,感谢TamásNepusz( @ntamas ):只需安装Anaconda Python的预编译二进制包:

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

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

It's that's simple. 这很简单。 (But I'm still puzzled by the conflict between the python igraph and the c libraries I experienced before. At least noe I have it working). (但是我仍然对python igraph和我之前经历的c库之间的冲突感到困惑。至少我没有它工作)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM