简体   繁体   中英

Issues installing pygrahviz "fatal error C1083: Cannot open include file: 'graphviz/cgraph.h': No such file or directory"

I'm unable to install pygraphviz even after installing graphviz and ensuring that cgraph.h is present in the directory.

I've also manually specified the directory for install. eg install-path

fatal error C1083: Cannot open include file: 'graphviz/cgraph.h': No such file or directory

Looking for any and all suggestions. Using Windows.

C:\Users\mmcgown\Desktop\School\MSDS452\pygraphviz-1.5>python setup.py install --prefix=C:\Program_Files_(x86)\Graphviz2.38 --include-path=C:\Program_Files_(x86)\Graphviz2.38\include\ --library-path=C:\Program_Files_(x86)\Graphviz2.38\lib\
running install
running build
running build_py
running egg_info
writing pygraphviz.egg-info\PKG-INFO
writing dependency_links to pygraphviz.egg-info\dependency_links.txt
writing top-level names to pygraphviz.egg-info\top_level.txt
reading manifest file 'pygraphviz.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.png' under directory 'doc'
warning: no files found matching '*.html' under directory 'doc'
warning: no files found matching '*.txt' under directory 'doc'
warning: no files found matching '*.css' under directory 'doc'
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '.svn' found anywhere in distribution
no previously-included directories found matching 'doc\build'
writing manifest file 'pygraphviz.egg-info\SOURCES.txt'
running build_ext
building 'pygraphviz._graphviz' extension
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.24.28314\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -IC:\Program_Files_(x86)\Graphviz2.38\include\ -IC:\Users\mmcgown\AppData\Local\Continuum\anaconda3\include -IC:\Users\mmcgown\AppData\Local\Continuum\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.24.28314\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.24.28314\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcpygraphviz/graphviz_wrap.c /Fobuild\temp.win-amd64-3.7\Release\pygraphviz/graphviz_wrap.obj
graphviz_wrap.c
pygraphviz/graphviz_wrap.c(2987): fatal error C1083: Cannot open include file: 'graphviz/cgraph.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.24.28314\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

For those who visit this page, you may already come across to this fix or this issue on GitHub and try to install GraphViz2.38 manually. But neither of them will work since GraphViz and PyGraphViz are 2 different libraries

Mac or Ubuntu already have their solutions on GitHub, however for Win10 64-bit, it does not receive any fix yet since 2018. Installing pygraphviz on Windows 10 64-bit, Python 3.6

Someone have created a build of PyGraphviz 1.5 on his Anaconda channel for Windows 64 bit running Python 3.6, Python 3.7 or Python 3.8. If you're running Anaconda, you can install with:

conda install -c alubbock pygraphviz

Please mark this as a possible duplicate with this question if someone see it.

在 Ubuntu 上,请执行
sudo apt install graphviz-dev

I installed the latest graphviz using the latest win64 executable from graphviz.org

graphviz 2.49 win64

then installation using the following command worked for me

pip install --global-option=build_ext --global-option="-IC:\Program Files\Graphviz\include" --global-option="-LC:\Program Files\Graphviz\lib" pygraphviz

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