问题
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