Error while uploading Networkit python module with Jupyter notebook

倖福魔咒の 提交于 2019-12-11 09:49:48

问题


I installed the Networkit module with conda install -c vgauthier networkit. If I import it in a notebook (import networkit as nk) I get this error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-a4c0096fb06c> in <module>()
----> 1 import networkit as nk

//anaconda/envs/py36/lib/python3.6/site-packages/networkit/__init__.py in <module>()
     41 # local imports
     42 from . import stopwatch
---> 43 from . import graph
     44 from . import graphio
     45 from . import community

//anaconda/envs/py36/lib/python3.6/site-packages/networkit/graph.py in <module>()
      1 # extension imports
----> 2 from _NetworKit import Graph, SpanningForest, GraphTools, RandomMaximumSpanningForest, UnionMaximumSpanningForest

ImportError: dlopen(//anaconda/envs/py36/lib/python3.6/site-packages/_NetworKit.cpython-36m-darwin.so, 2): Library not loaded: @rpath/libomp.dylib
  Referenced from: //anaconda/envs/py36/lib/python3.6/site-packages/_NetworKit.cpython-36m-darwin.so
  Reason: image not found

Anyone able to explain why? ​


回答1:


I happened to have the same problem for networkit via pip. It is because the networkit installed by anaconda does not link to your gcc compiler correctly, a simple fix is to download the networkit's source code and run python3 setup.py install to install it.




回答2:


I had the same problem: https://github.com/kit-parco/networkit/issues/172

It's because of anaconda Python. Re-install it using:

conda install -c vgauthier networkit


来源:https://stackoverflow.com/questions/49012764/error-while-uploading-networkit-python-module-with-jupyter-notebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!