0
votes

I have tried to install python-igraph using pip install but got an error message when importing it:

:~$ pip install python-igraph
Collecting python-igraph
Installing collected packages: python-igraph
Successfully installed python-igraph-0.7.1.post6
:~$ python
Python 2.7.12 |Anaconda 4.2.0 (64-bit)| (default, Jul  2 2016, 17:42:40) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import igraph
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/anaconda2/lib/python2.7/site-packages/igraph/__init__.py", line 34, in <module>
    from igraph._igraph import *
ImportError: /home/user/anaconda2/lib/python2.7/site-packages/igraph/_igraph.so: undefined symbol: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1Ev

I then tried to install through anaconda , which also led to an error:

    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/home/user/anaconda2/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-65xDUp/python-igraph/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-LIJjEG-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-65xDUp/python-igraph/

The full error message is in here - link. Last time I've installed igraph on Ubuntu there wasn't any problem like that. Anyone has encountered this and know how to solve it?

1
second error shows only few last lines - look in rest of lines and search if there is something about python.h or other .h files - it seams it can't find some files to compile it. - furas
I've found Cannot find the C core of igraph on this system using pkg-config. We will now try to download and compile the C core from scratch., and then Could not download and compile the C core of igraph.. What could be the reason? - Ohm
you have to show all lines. It tries to compile C code but it has problem. Mostly it needs some C headers in files *.h so you have to install some library - but it denend on what you have in error message. - furas
Here is the full error message - dpaste.com/29EVF25 - Ohm
I tried on my Linux Mint and have the same error - it can't download C source code. I tried apt search igrahp and there is libigraph0 and libigraph-dev (files *.h) so I installed apt install libigraph-dev but it installed older version 0.6.5 and pip had different problem - it can't compile because it use differnent code. SO you have to download igraph manually or wait till they remove that bug. - furas

1 Answers

2
votes

Having the same problem. pip install is more verbose, though:

curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "igraph"
Download failed: http://igraph.org/nightly/get/c/igraph-0.7.1.tar.gz

Seems like http://igraph.org/nightly is not reachable.