I cannot import igraph on mac 10.6

I have installed igraph for python on my mac, but I cannot import it. I first installed the C core library, then I started the installation for python by running:

python setup.py build
python setup.py install

      

Everything seemed to work fine, but I can't seem to import the igraph from the python shell. Just to be clear, I'm not in the source code folder and the graphics. And I got this error:

import igraph
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.macosx-10.3-fat/egg/igraph/__init__.py", line 30, in <module>

  File "build/bdist.macosx-10.3-fat/egg/igraph/core.py", line 7, in <module>
  File "build/bdist.macosx-10.3-fat/egg/igraph/core.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/*****/.python-eggs/python_igraph-0.5.4-py2.7-macosx-10.3-fat.egg-tmp/igraph/core.so, 2): Symbol not found: _igraph_vector_destroy
  Referenced from: /Users/*****/.python-eggs/python_igraph-0.5.4-py2.7-macosx-10.3-fat.egg-tmp/igraph/core.so
  Expected in: dynamic lookup

      

I changed my folder name to * , so I'm not considering it.

I am running python 2.7 on top of OS 10.6.7. So there is no pre-compiled version of igraph available (2.5 and 2.6 only). Does this error have anything to do with the version of python I'm running? If possible, how can I fix this?

+1


source to share


1 answer


I think the problem is that igraph is set to /usr/local/lib/libigraph.dylib

, but the linker cannot find it when Python tries to load the C kernel of the igraph module because it is /usr/local/lib

not in the default library path on Mac OS X (At least I am like this I think).

First check to see if it really libigraph.dylib

is in /usr/local/lib

- it should be there. Then try the following:



DYLD_LIBRARY_PATH=/usr/local/lib python -m igraph.test.__init__

      

This should indicate what the linker looks at /usr/local/lib

as well as default locations, and then runs Python with the entire igraph test suite.

+1


source







All Articles