有人成功地在Windows10 64位上安装了pygraphviz吗?我尝试了蟒蛇3.5 64位和32位,但没有成功。
下面是我在win10 64位上使用python 3.5 32位得到的错误

python -m pip install pygraphviz --install-option="--include-path=C:\Program Files (x86)\Graphviz2.38\include" --install-option="--library-path=C:\Program Files (x86)\Graphviz2.38\lib"

错误:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD "-IC:\Program Files (x86)\Graphviz2.38\include" -IC:\Users\tra20\Anaconda3\include -IC:\Users\tra20\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tcpygraphviz/graphviz_wrap.c /Fobuild\temp.win32-3.5\Release\pygraphviz/graphviz_wrap.obj
graphviz_wrap.c
pygraphviz/graphviz_wrap.c(3321): warning C4047: 'return': 'int' differs in levels of indirection from 'Agsym_t *'
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO "/LIBPATH:C:\Program Files (x86)\Graphviz2.38\lib" /LIBPATH:C:\Users\tra20\Anaconda3\libs /LIBPATH:C:\Users\tra20\Anaconda3\PCbuild\win32 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86" cgraph.lib cdt.lib /EXPORT:PyInit__graphviz build\temp.win32-3.5\Release\pygraphviz/graphviz_wrap.obj /OUT:build\lib.win32-3.5\pygraphviz\_graphviz.cp35-win32.pyd /IMPLIB:build\temp.win32-3.5\Release\pygraphviz\_graphviz.cp35-win32.lib
LINK : fatal error LNK1181: cannot open input file 'cgraph.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\link.exe' failed with exit status 1181

我想这和graphviz以32位连接的事实有关吧?
注意-我尝试了所有在互联网上找到的pygraphviz二进制文件(anaconda,internet),但没有一个在win10 64位上工作…如果你有任何工作(我是说你真的测试过它),我也会很高兴…

最佳答案

从这里开始阅读
https://github.com/pygraphviz/pygraphviz/issues/58
在该页的底部有一个指向GitHub中x64 zip文件的链接
解包,为您的x64文件创建一个coresponding program files文件夹,并将它们放在那里。
然后用这个安装

pip install --global-option=build_ext --global-option="-IC:\Program Files\Graphviz2.38\include" --global-option="-LC:\Program Files\Graphviz2.38\lib\release\lib" pygraphviz

10-05 19:32