简体   繁体   中英

install pygraphviz on anaconda error

I try to install pygraphviz on Anaconda. I have done everything I found:

- 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. 

After step 4, I got the following error:

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

Can anyone give me some advice ?

I just faced the same problem. The include path is incorrect. Use

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

instead. Otherwise you get

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM