I put together a small list on instructions required to install
pygraphviz on windows - I couldn't find all the information together
in one place, so perhaps this can be useful to other people:
1- Download the latest version of pygraphviz from:
http://networkx.lanl.gov/download/pygraphviz/
2- Download the latest version of graphviz from:
http://www.graphviz.org/Download_windows.php
3- Unzip pygraphviz to an easy location.
4- Open up setup.py in pygraphviz:
In line 31 and 32, edit:
library_path=r'C:\Program Files (x86)\Graphviz2.26.3\lib\debug\lib'
include_path=r'C:\Program Files (x86)\Graphviz2.26.3\include\graphviz'
or wherever you installed graphviz on your machine
5- Go down to line 107, where the compiler extensions are defined and
change it to this:
extension = [Extension("pygraphviz._graphviz",
["pygraphviz/graphviz_wrap.c"],
include_dirs=include_dirs,
#library_dirs=library_dirs,
#runtime_library_dirs=library_dirs,
extra_link_args=["/LIBPATH:"+library_path],
libraries=["cgraph","cdt"],
)]
basically comment out library_dirs and run_time_library, and add the
extra_link_args parameter
6- If you have developer studio 2008, you can now install it. Switch
to the directory, and type:
python setup.py install
and it should install relatively painlessly.
7- If you do have developer studio 2010, you'll find that your version
isn't compatible - you need either mingGW or visual studio 2008. I
found minGW gives a lot of errors so install visual studio 2008. If
you use minGW, you have to revert the changes you made to extension at
point 5.
At this point, I am sure all the Linux users are feeling very smug
about how 'easy to use' Windows is :p These instructions were
sufficient to install it on two different machines though, one xp and
one windows 7.