1.首先安装graphviz, http://www.graphviz.org/pub/graphviz/stable/windows/graphviz-2.28.0.msi
2.下载pygraphviz源码包,http://pypi.python.org/packages/source/p/pygraphviz/pygraphviz-1.1.zip#md5=9b9958f10bdf29c06d9f43e225f6ac0c
3. 解压后修改setup.py,三个地方要改
library_path=r'D:\Graphviz 2.28\bin' #按你的graphviz路径修改
include_path=r'D:\Graphviz 2.28\include\graphviz' #按你的graphviz路径修改
runtime_library_dirs=None
4. 安装Mingw,http://sourceforge.net/projects/mingw/files/MinGW/,添加PATH变量D:\MinGW\bin #按你的mingw安装路径修改
5. python setup.py build -c mingw32 ,如果提示“-mno-cygwin错误”,则删除Python目录下/lib/distutils/cygwinccompiler.py中的几处-mno-cygwin即可。
6. python setup.py install