Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Installing Graphite on OS X Lion using brew, pythonbrew and virtualenv

This is a general overview (from memory) of the steps I used to install graphite ( on OS X Lion. I think the steps are in order but YMMV. Please fork and fix if you find an error.

Install Python 2.7.2

curl -kL | bash
echo '[[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc' >> ~/.bashrc
[[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc
pythonbrew install 2.7.2
pythonbrew use 2.7.2
pythonbrew venv create graphite
pythonbrew venv use graphite

Check your env

$ python --version
Python 2.7.2

$ type python
python is /Users/oyiptong/.pythonbrew/pythons/Python-2.7.2/bin/python

$ file `which python`
/Users/oyiptong/.pythonbrew/pythons/Python-2.7.2/bin/python: Mach-O 64-bit executable x86_64

Install Cairo

brew install cairo

Instally py2cairo [CRAZY TRAIN]

git clone git://
# Open wscript and below `env = ctx.env` add `env.append_unique('CFLAGS', ['-arch', 'x86_64'])`

export PYTHONPATH=/Users/oyiptong/.pythonbrew/pythons/Python-2.7.2
export PATH=/Users/oyiptong/.pythonbrew/pythons/Python-2.7.2/bin:$PATH
export LD_LIBRARY_PATH=/Users/oyiptong/.pythonbrew/pythons/Python-2.7.2/:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/Users/oyiptong/.pythonbrew/pythons/Python-2.7.2/lib:$LD_LIBRARY_PATH
export LINKFLAGS='-search_dylibs_first -L /Users/oyiptong/.pythonbrew/pythons/Python-2.7.2/lib'
export ARCHFLAGS='-arch x86_64'
export CC=/usr/bin/gcc
export PKG_CONFIG_PATH=/usr/local/Cellar/cairo/1.10.2/lib/pkgconfig

python waf clean
python waf configure --libdir=/Users/oyiptong/.pythonbrew/venvs/Python-2.7.2/graphite/lib
python waf build
python waf install

Install Graphite and Dependencies

pip install carbon
pip install whisper
pip install django==1.3.1
pip install django-tagging
pip install graphite-web

Create default database

cd /opt/graphite/webapp/graphite
python syncdb

Move example configs

cd /opt/graphite/conf
cp storage-schemas.conf.example storage-schemas.conf
cp carbon.conf.example carbon.conf

Start carbon

./bin/ start

Start Graphite

./bin/ /opt/graphite

Hope like hell it works


If it works correclty you should see a black image with "No Data" in the Graphite Composer. If you see a broken image, it's probably something to do with py2cairo and cairo.


This comment has been minimized.

Copy link

23inhouse commented Jul 28, 2012

The crazy train section seems to work now as:

brew install py2cairo

This comment has been minimized.

Copy link

1tylermitchell commented Jul 16, 2013

Thanks a ton for sharing this.


This comment has been minimized.

Copy link

davidradernj commented May 31, 2016

pip install "django<1.9"
pip install twisted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.