Search code examples
eclipsepython-3.xigraphcairo

No module named cairo - Mac


Why is it so effin' hard? Seems to be an ever-present issue..solved unclearly.

  1. Searched on multiple github pages, advised to use import cairocffi as cairo instead, not working for me.

  2. Some more on Stackoverflow, to add sys.path.insert(0, "//anaconda/pkgs/cairo-1.14.10-0") or something. But in fact, sys.path returns the directory anyway.

Quite sure installation done correctly as I can see under conda list.

enter image description here

Bad feeling this is gonna take a whole lot longer due to my little understanding of the os environment.

Can someone save me, all I want is to test igraph.plot

Update brew install py2cairo somehow helped PYTOHNPATH on the terminal to figure out the library location, but it still fails to locate it in eclipse.

Of course added on Preference manually..why can't it import?


Solution

  • import cairocffi as cairo did it at the end.

    Had to install cairocffi, on top of all the manual reinstall. (I had brew install, Mac still accepted the install)

    If you want to plot using igraph, no need to hassle with importing any of these libraries explicitly.

    Related thread on superuser. Posted some useful references some may come across.