pygraphviz及其在windows下的安装
时间:2009-03-16 来源:linxh
Graphviz - Graph Visualization Software
Graph visualization is a way of representing structural information as diagrams of abstract graphs and networks. Automatic graph drawing has many important applications in software engineering, database and web design, networking, and in visual interfaces for many other domains.
Graphviz is open source graph visualization software. It has several main graph layout programs. See the gallery for some sample layouts. It also has web and interactive graphical interfaces, and auxiliary tools, libraries, and language bindings.
pygraphviz
http://networkx.lanl.gov/pygraphviz/
Windows下pygraphviz的安装
1. 安装graphviz
2. 下载pygraphviz源代码
3. 修改pygraphviz的setup.py,
library_path="C:\\Program Files\\Graphviz2.20\\lib"
include_path="C:\\Program Files\\Graphviz2.20\\include\\graphviz"
将148行中的extension定义中的runtime_library_dirs改成None,
4. python setup.py install
Trouble Shooting
安装的时候不知道什么原因,import pygraphviz的时候,出现
ImportError: DLL load failed with error code 193
后来在控制台中运行python(而不是在IDLE中),import的时候出现了更多的提示,提示是一个so文件不是合法的windows程序(?),不知为什么,后来将编译出来的pyd文件覆盖(_graphviz),貌似解决问题了