Skip to content

Instantly share code, notes, and snippets.

Forked from caged/
Created May 17, 2012 18:14
Show Gist options
  • Save surjikal/2720651 to your computer and use it in GitHub Desktop.
Save surjikal/2720651 to your computer and use it in GitHub Desktop.
Installing Graphite on OS X Lion

Follow these steps to install graphite on OS X Lion.


  • Python 2.7
  • Brew
  • Git

Install dependencies

Install Cairo

brew install cairo

Install py2cairo

Clone the repo:

git clone git://
cd py2cairo

We need to set up a bunch of environment variables:

export PYTHONPATH='/System/Library/Frameworks/Python.framework/Versions/2.7'
export LINKFLAGS='-search_dylibs_first -L /System/Library/Frameworks/Python.framework/Versions/2.7/lib/'
export ARCHFLAGS='-arch x86_64'
export CC='/usr/bin/gcc'
export PKG_CONFIG_PATH='/usr/local/Cellar/cairo/1.10.2/lib/pkgconfig/'

Then we can proceed with the installation:

python waf clean
python waf configure --prefix=$PYTHONPATH
python waf build
python waf install

Install Django

pip install django
pip install django-tagging

Install Graphite

pip install carbon
pip install whisper
pip install graphite-web

Configure graphite

cp /opt/graphite/conf/carbon.conf{.example,}
cp /opt/graphite/conf/storage-schemas.conf{.example,}

Create default database

cd /opt/graphite/webapp/graphite

# Modify this file to change database backend (default is sqlite).

# Initialize database
python syncdb

Start carbon

python /opt/graphite/bin/ start

Start Graphite

python /opt/graphite/bin/ /opt/graphite

Hope that it works!

Go to:


You should see this if it works properly:


If you get a broken image, it most likely means that something is wrong py2cairo and cairo.

Check the debug output here:


Additional resources

Copy link

My cairo installation was failing on with "brew install cairo".

Solved it by using : "brew install cairo --use-clang"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment