install
-
install graphviz
$ brew install graphviz
-
download pygraphviz
-
edit
setup.py
$ pico setup.py ... include_dirs=['/usr/local/lib/graphviz'], library_dirs=['/url/local/include/graphviz'], ....
-
$ sudo python setup.py install --include-path=/usr/local/Cellar/graphviz/2.38.0/include --library-path=/usr/local/Cellar/graphviz/2.38.0/lib
-
quick example
>>> import pygraphviz as pgv >>> G=pgv.AGraph() >>> G.add_node('a') >>> G.add_edge('b','c') >>> G strict graph { a; b -- c; } # load dot file >>> G=pgv.AGraph("file.dot")