在Windows上安装pygraphviz [英] Installing pygraphviz on windows

查看:85
本文介绍了在Windows上安装pygraphviz的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows 7 Ultimate 64位上安装最新的graphviz(2.26.3)之后,出现以下错误:

After installing the latest graphviz (2.26.3) on my Windows 7 Ultimate 64bit, I receive the following error:

C:> easy_install pygraphviz搜索 pygraphviz阅读 http://pypi.python.org/simple/pygraphviz/ http://networkx.lanl.gov/pygraphviz http://networkx.lanl.gov/wiki/download http://networkx.lanl.gov/download/pygraphviz http://sourceforge.net/project/showfiles.php?group_id= 122233& package_id = 161979 http://networkx.lanl.gov/download 最佳 匹配:pygraphviz 1.1.dev1947 正在下载 http://networkx.lanl.gov/download/pygraphviz/pygraphviz-1.1.dev1947.tar.gz 加工 pygraphviz-1.1.dev1947.tar.gz正在运行 pygraphviz-1.1.dev1947 \ setup.py -q bdist_egg --dist-dir c:\ users \ jonathan \ appdata \ local \ temp \ easy_install-apywwk \ pygraphviz-1.1.dev1947 \ egg-dist-tmp-nvd0pa 尝试pkg-config找不到 pkg-config尝试dotneato-config 找不到dotneato-config

C:>easy_install pygraphviz Searching for pygraphviz Reading http://pypi.python.org/simple/pygraphviz/ Reading http://networkx.lanl.gov/pygraphviz Reading http://networkx.lanl.gov/wiki/download Reading http://networkx.lanl.gov/download/pygraphviz Reading http://sourceforge.net/project/showfiles.php?group_id=122233&package_id=161979 Reading http://networkx.lanl.gov/download Best match: pygraphviz 1.1.dev1947 Downloading http://networkx.lanl.gov/download/pygraphviz/pygraphviz-1.1.dev1947.tar.gz Processing pygraphviz-1.1.dev1947.tar.gz Running pygraphviz-1.1.dev1947\setup.py -q bdist_egg --dist-dir c:\users\jonathan\appdata\local\temp\easy_install-apywwk\pygraphviz-1.1.dev1947\egg-dist-tmp-nvd0pa Trying pkg-config Failed to find pkg-config Trying dotneato-config Failed to find dotneato-config

您的graphviz安装无法 被发现.

Your graphviz installation could not be found.

缺少graphviz软件包 不完整(二进制包) graphviz-dev或graphviz-devel 失踪了吗?).

Either the graphviz package is missing on incomplete (binary packages graphviz-dev or graphviz-devel missing?).

如果您认为您的安装是 正确,您将需要手动 更改include_path并 setup.py中的library_path变量 指向您的正确位置 graphviz安装.

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

library_path的当前设置 并且include_path是:library_path = None include_path =无

The current setting of library_path and include_path is: library_path=None include_path=None

错误:无

有什么想法要解决这个问题吗?
这似乎是与此处所述的问题不同的问题. br> 有没有人在Windows上成功安装pygraphviz?怎么样?

Any thoughts how to fix this?
This seems to be a different problem than the one described here.
Has anyone had success in installing pygraphviz on Windows? How?

推荐答案

这对我有用. 前提条件:安装mingw32(如果使用的话,包含在pythonxy distrib中)

Here's what worked for me. Precondition: Install mingw32 (included in pythonxy distrib if you're using it), Graphviz

1)下载pygraphviz来源

1) Download pygraphviz sources

2)编辑setup.py以将路径更改为类似

2) Edit setup.py to change paths to smth like

library_path=r"c:\Program Files (x86)\Graphviz 2.28\bin"
include_path=r"c:\Program Files (x86)\Graphviz 2.28\include\graphviz"

请注意,它是\ bin,而不是\ lib.与库链接对我不起作用.

Note that it's \bin, not \lib. Linking with libs didn't work for me.

3)运行python setup.py build -c mingw32

第3步的结果

c:\Python27\Lib\site-packages\pygraphviz-1.1>python setup.py build -c mingw32
library_path=c:\Program Files (x86)\Graphviz 2.28\bin
include_path=c:\Program Files (x86)\Graphviz 2.28\include\graphviz
running build
running build_py
running build_ext
building 'pygraphviz._graphviz' extension
C:\MinGW32-xy\bin\gcc.exe -mno-cygwin -mdll -O -Wall "-Ic:\Program Files (x86)\G
raphviz 2.28\include\graphviz" -Ic:\Python27\include -Ic:\Python27\PC -c pygraph
viz/graphviz_wrap.c -o build\temp.win32-2.7\Release\pygraphviz\graphviz_wrap.o
pygraphviz/graphviz_wrap.c: In function 'agattr_label':
pygraphviz/graphviz_wrap.c:2855:5: warning: return makes integer from pointer wi
thout a cast
writing build\temp.win32-2.7\Release\pygraphviz\_graphviz.def
C:\MinGW32-xy\bin\gcc.exe -mno-cygwin -shared -s build\temp.win32-2.7\Release\py
graphviz\graphviz_wrap.o build\temp.win32-2.7\Release\pygraphviz\_graphviz.def "
-Lc:\Program Files (x86)\Graphviz 2.28\bin" -Lc:\Python27\libs -Lc:\Python27\PCb
uild "-Wl,-Rc:\Program Files (x86)\Graphviz 2.28\bin" -lcgraph -lcdt -lpython27
-lmsvcr90 -o build\lib.win32-2.7\pygraphviz\_graphviz.pyd

4)将结果从刚刚构建的lib.win32-2.7(称为pygraphviz的单个子文件夹)复制到Python的site-packages文件夹中

4) copy the result from the just built lib.win32-2.7 (single sub-folder called pygraphviz) into your Python's site-packages folder

享受!

这篇关于在Windows上安装pygraphviz的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆