0

I've been trying to use igraph in python for network analysis, but whenever I try to import igraph I get the following error:

OSError: no library called "cairo" was found
cannot load library 'C:\Users\Nate\Anaconda3\libcairo-2.dll': error 0x7e
cannot load library 'libcairo.so.2': error 0x7e
cannot load library 'libcairo.2.dylib': error 0x7e
cannot load library 'libcairo-2.dll': error 0x7e

I followed the directions here: How to install cairo on Windows

to install cairo through GTK, but I'm still getting this error message. I was able to get msys64 (https://www.gtk.org/docs/installations/windows/) working, and that seemed to install the one libcairo-2.dll and I copied it into my anaconda directory, but I couldn't find the other missing files. In the error message, you can see that anaconda recognizes the dll, but can't load it.

One step I was not able to follow from the linked instructions was cabal install gtk2hs-buildtools then cabal install gtk. I added the msys64 directory to my windows path, but the cabal command was not recognized in the msys64 or windows command lines.

Please help this newbie if you can!

natec
  • 53
  • 8
  • 2
    The easiest thing is to install `python-igraph` in Anaconda using `conda install -c conda-forge python-igraph`. That way, the necessary `cairo` libraries will be automatically installed. – Vincent Traag Nov 26 '20 at 05:38

1 Answers1

0

Thanks Vincent Traag! That worked, and was much simpler than any of the methods I had previously seen!

For anyone finding this later execute this command in the Anaconda Powershell to install igraph for python:

conda install -c conda-forge python-igraph
natec
  • 53
  • 8