Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
508 views
in Technique[技术] by (71.8m points)

failed installation - Installing pygraphviz on windows

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

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.dev1947setup.py -q bdist_egg --dist-dir c:usersjonathanappdatalocalempeasy_install-apywwkpygraphviz-1.1.dev1947egg-dist-tmp-nvd0pa Trying pkg-config Failed to find pkg-config Trying dotneato-config Failed to find dotneato-config

Your graphviz installation could not be found.

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

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.

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

error: None

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

1) Download pygraphviz sources

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

library_path=r"c:Program Files (x86)Graphviz 2.28in"
include_path=r"c:Program Files (x86)Graphviz 2.28includegraphviz"

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

3) run python setup.py build -c mingw32

Result of step 3:

c:Python27Libsite-packagespygraphviz-1.1>python setup.py build -c mingw32
library_path=c:Program Files (x86)Graphviz 2.28in
include_path=c:Program Files (x86)Graphviz 2.28includegraphviz
running build
running build_py
running build_ext
building 'pygraphviz._graphviz' extension
C:MinGW32-xyingcc.exe -mno-cygwin -mdll -O -Wall "-Ic:Program Files (x86)G
raphviz 2.28includegraphviz" -Ic:Python27include -Ic:Python27PC -c pygraph
viz/graphviz_wrap.c -o buildemp.win32-2.7Releasepygraphvizgraphviz_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 buildemp.win32-2.7Releasepygraphviz\_graphviz.def
C:MinGW32-xyingcc.exe -mno-cygwin -shared -s buildemp.win32-2.7Releasepy
graphvizgraphviz_wrap.o buildemp.win32-2.7Releasepygraphviz\_graphviz.def "
-Lc:Program Files (x86)Graphviz 2.28in" -Lc:Python27libs -Lc:Python27PCb
uild "-Wl,-Rc:Program Files (x86)Graphviz 2.28in" -lcgraph -lcdt -lpython27
-lmsvcr90 -o buildlib.win32-2.7pygraphviz\_graphviz.pyd

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

Enjoy!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...