Finally get cairo to work with igraph

I have an anaconda distribution of python, so I tried

conda install cairo

conda install pycairo

But the latter throws error cannot find pixman even after I conda install pixman succesfully. So I gave up on this route and

brew install cairo

brew install py2cairo

This way cairo is installed in the brew directory. To use it with anaconda python, add it to the sys path

import sys

sys.path.append(“/usr/local/lib/python2.7/site-packages”)

Then it works!

p.s. to manually compile pycairo, remember to add cairo to the path because I had hard time to have configure find cairo. This is not necessary if you use brew.

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig

pkg-config –cflags-only-I cairo

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s