Skip to content Skip to sidebar Skip to footer

Installation Of Igraph On Python Distributed By Anaconda ? (and Graphviz)

I tried to install the package igraph on Anaconda but so far it did not work. If anyone find a way to get it, I would be very happy to try it !! Below are some details of what I tr

Solution 1:

Okay, there are multiple questions here so I'll try to answer them one by one.

  1. The version number that you see there has nothing to do with the "official" version number of libxml2 (which is, by the way, 2.9.2 at the time of writing and not 9.2). This is the version number of the Application Binary Interface (ABI) of the library. Some projects choose to keep the version number of the ABI in sync with the "public" version number of the library, but this is not required. You can check the ABI version of a library on Mac with otool -L; e.g., otool -L /usr/lib/libxml2.2.dylib gives me current version 10.9.0 on my Mac.

    Now, it seems to be the case that there are multiple copies of libxml2 on your system. One comes from OS X itself, this is in /usr/lib. Another one is installed from brew - this is somewhere in /usr/local/lib. And maybe there's a third one from Anaconda Python. The problem is that igraph was linked to one of these (with ABI version 12.0.0) while it was compiled, but when you try to import igraph, the system does not find this libxml2 and tries to link to another one with ABI version 10.0.0 instead. It is up to you to sort this out. First, I would look for all occurrences of libxml2*.dylib on your machine and run otool -L on all of them to see which one has ABI version 12.0.0 - this is the one that igraph was linked to. Then you could try to rename this library temporarily while compiling and installing igraph (to prevent the linker from finding it and linking to it), and rename it back after the installation finished. This way you may be able to obtain a compiled version of igraph that links to the "right" version of libxml2.

  2. Brew will not install libxml2 that comes from Anaconda Python, and rightly so - it is in general a bad idea to let one piece of software (i.e. Brew) mess around with the dependencies of another piece of software (i.e. Anaconda Python).

  3. igraph tries to find its C core using pkg-config during compilation time; in particular, it executes pkg-config --cflags --libs igraph. Does this work for you from the command line?


Post a Comment for "Installation Of Igraph On Python Distributed By Anaconda ? (and Graphviz)"