4
votes

After installing python-igraph with pip, I still can't import it. I've encountered such error around the internet but most solutions I've found were about reinstalling the module, which I already did. Any suggestions on how to fix this would be greatly appreciated. Thanks

>>> import igraph
Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python3.5/site-packages/igraph/__init__.py", line 34, in <module>
      from igraph._igraph import *
ImportError: /usr/lib/python3.5/site-packages/igraph/_igraph.cpython-35m-x86_64-linux-gnu.so: undefined symbol: _ZTVN10__cxxabiv121__vmi_class_type_infoE
1
Someone else was already running into this issue; see one of neuralyzer's comment in this Github issue. A solution was proposed straight below his comment on October 17, 2014. Does this help by any chance? If not, let me know which OS you are running and I'll try to reproduce this in a VM.Tamás
I tried using this solution but such errors appeared: when trying to do "python setup.py build" : /usr/bin/ld: /usr/lib64/libm.a(s_atan.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/lib64/libm.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status error: command 'gcc' failed with exit status 1 |||| And when trying to run "sudo python setup.py" by ignoring what's above, I get the same error message. I'm trying to run all of this in a 64 bits Arch Linuxbmo
Seems like this is specific to Arch Linux then - the original Github issue also mentions Arch Linux. Is there any reason why you cannot use the python-igraph package from Arch Linux itself? If there is, try installing only the C core of igraph from the igraph package, then re-run pip - it should then discover that the C core is already installed and only compile the glue code between C and Python.Tamás

1 Answers

1
votes

Uninstalling everything through pip and then installing python-igraph community repo package for arch linux did it. Didn't realize there was one. Suggested by Tamás.