Graphviz is an awesome tools that can draw gorgeous graph like in this project. When developing with python, a binding named pygraphviz is available. It is used for example in django-extension to graph data models.

Unfortunately when trying to install it on Mac OS X an error is raised even if graphviz is installed (brew install graphviz).

Running setup.py install for pygraphviz
    error: Error locating graphviz

        ...

    Your Graphviz installation could not be found.

            1) You don't have Graphviz installed:
               Install Graphviz (http://graphviz.org)
            2) Your Graphviz package might incomplete.
               Install the binary development subpackage (e.g. libgraphviz-dev or similar.)
            3) You are using Windows
               There are no PyGraphviz binary packages for Windows but you might be
               able to build it from this source.  See
               http://networkx.lanl.gov/pygraphviz/reference/faq.html

            If you think your installation is correct you will need to manually
            change the include_dirs and library_dirs variables in setup.py to
            point to the correct locations of your graphviz installation.

            The current setting of library_dirs and include_dirs is:

    library_dirs=None
    include_dirs=None

To solves this error additional parameters have to be specified:

--install-option="--include-path=/usr/local/include/graphviz/" \
--install-option="--library-path=/usr/local/lib/graphviz"

Of course check that this repository points to your graphviz installation (should be the case when installed from source or via brew).

This parameters can be either provided either when running pip directly (pip install pygraphviz --install-option...) or a requirements file (pygraphviz>=1.3 --install-option...). When installing directly running setup.py parameters have to be provided directly without the --install-option:

python setup.py install --include-path=... --library-path=...