编程语言
首页 > 编程语言> > python – 在anaconda错误上安装pygraphviz

python – 在anaconda错误上安装pygraphviz

作者:互联网

我尝试在Anaconda上安装pygraphviz.我做了我发现的一切:

- install graphviz.
- install mingw.
- change values in the setup.py for pygraphviz as below:
   include_dirs = 'C:/Program Files (x86)/Graphviz2.38/include/graphviz'
   library_dirs = 'C:/Program Files (x86)/Graphviz2.38/lib'
-  run python setup.py build -c mingw32 install. 

在第4步之后,我收到以下错误:

running install
running build
running build_py
running build_ext
building 'pygraphviz._graphviz' extension
C:\MinGW\bin\gcc.exe -mdll -O -Wall -DGVDLL "-IC:/Program Files (x86)/Graphviz2.38/include/graphviz" -IC:\Users\garre_000\Anaconda3\
include -IC:\Users\garre_000\Anaconda3\include -c pygraphviz/graphviz_wrap.c -o build\temp.win-amd64-3.4\Release\pygraphviz\graphviz
_wrap.o
pygraphviz/graphviz_wrap.c:2954:29: fatal error: graphviz/cgraph.h: No such file or directory
 #include "graphviz/cgraph.h"
                             ^
compilation terminated.
error: command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1

谁能给我一些建议?

解决方法:

我刚遇到同样的问题.包含路径不正确.使用

include_dirs = 'C:/Program Files (x86)/Graphviz2.38/include'

代替.否则你会得到

'C:/Program Files (x86)/Graphviz2.38/include/graphviz/graphviz/cgraph.h'

标签:python,pygraphviz
来源: https://codeday.me/bug/20190624/1276085.html