5

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
bmo
  • 147
  • 1
  • 11
  • Someone else was already running into this issue; see one of neuralyzer's comment in [this Github issue](https://github.com/igraph/igraph/issues/598). 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 Nov 10 '15 at 23:44
  • 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 Linux – bmo Nov 11 '15 at 00:35
  • 1
    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`](https://www.archlinux.org/packages/community/x86_64/python-igraph/) package from Arch Linux itself? If there is, try installing only the C core of igraph from the [`igraph`](https://www.archlinux.org/packages/community/x86_64/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 Nov 11 '15 at 09:15

1 Answers1

1

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.

bmo
  • 147
  • 1
  • 11
  • Yes had the same issue, "pacman -S python-igraph" instead of installing from pip did the trick on Arch. – The Demz Jun 30 '16 at 12:56