brew install python
brew install cairo
brew install py2cairo
$ python
Python 2.7.3 (default, Jun 17 2012, 23:27:13)
[GCC 4.2.1 Compatible Apple Clang 3.1 (tags/Apple/clang-318.0.58)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cairo
>>>
sudo mkdir /opt/graphite
chown root:admin /opt/graphite
chmod g+w /opt/graphite
cd /opt/graphite
virtualenv .ve
/opt/graphite/.ve/bin/pip install carbon
-- got an error here regarding Twisted. Doing easy_install twisted fixed this.
/opt/graphite/.ve/bin/pip install whisper
/opt/graphite/.ve/bin/pip install django
-- As above, I got an error with pip, but easy_install worked.
/opt/graphite/.ve/bin/pip install django-tagging
/opt/graphite/.ve/bin/pip install graphite-web
-- Note, run as sudo or it won't actually install the package under /opt/graphite/webapp
cd /opt/graphite/webapp/graphite
-- This failed for me. To fix it, I had to copy local_settings.py.example to local_settings.py and uncomment the DATABASES entry.
sudo python manage.py syncdb
sudo chown -R nobody:nobody /opt/graphite/storage/
cd /opt/graphite/conf
cp storage-schemas.conf.example storage-schemas.conf
cp carbon.conf.example carbon.conf
mkdir /opt/graphite/bin
ln -s /usr/local/share/python/carbon-cache.py bin
python ./bin/carbon-cache.py start
python /usr/local/share/python/run-graphite-devel-server.py /opt/graphite
-- Note: here I got an error from setuptools being unable to locate graphite-web. Reloading virtualenv fixed this.
http://localhost:8080
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. -- Note, under mountain lion got 500 errors indicating that the cairo library couldn't be found. Even though an "import cairo" from a python prompt would work. Still investigating.
i finally got this working when i rebuilt the virtual env with the system packages (i.e. virtualenv --system-site-packages .ve) ... this is needed to copy the pycairo packages you installed with brew into the virtual environment where you are running the graphite-web from.
also, for some reason it was complaining that django-admin wasn't in my path, so I added /opt/graphite/bin and /opt/graphite/.ve/bin to my path before starting the web service