1

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? ​

sato
  • 609
  • 5
  • 21

2 Answers2

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.

saiba
  • 31
  • 4
0

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
Alex
  • 736
  • 1
  • 7
  • 20