首页 > 解决方案 > Cygwin 安装:graphviz 和/或 libcgraph 缺少文件?

问题描述

我一直在尝试在 cygwin 上“pip install pygraphviz”并不断遇到缺少的依赖项。我确实在 cygwin 下安装了 libcgraph6-2.40.1-3 和 graphviz-2.40.1-3。软件包列表中没有可用的 graphviz-devel (graphviz-debug 也无济于事)。

首先它找不到 cgraph.h 或 cdt.h:

 gcc -fno-strict-aliasing -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/usr/src/ports/python2/python2-2.7.15-1.x86_64/build=/usr/src/debug/python2-2.7.15-1 -fdebug-prefix-map=/usr/src/ports/python2/python2-2.7.15-1.x86_64/src/Python-2.7.15=/usr/src/debug/python2-2.7.15-1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include/python2.7 -c pygraphviz/graphviz_wrap.c -o build/temp.cygwin-3.0.3-x86_64-2.7/pygraphviz/graphviz_wrap.o
  pygraphviz/graphviz_wrap.c:2987:10: fatal error: graphviz/cgraph.h: No such file or directory
   #include "graphviz/cgraph.h"
            ^~~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command 'gcc' failed with exit status 1

graphvize/cdt.h 的错误完全相同。我想知道是否还缺少其他任何东西。所以我通过在 cygwin 包源 tgz 中找到这些头文件,并将它们复制到 /usr/include/graphviz/ 中来作弊。下一个 pip 安装失败,因为(惊喜,惊喜)它也找不到库:

 gcc -shared -Wl,--enable-auto-image-base -L. build/temp.cygwin-3.0.3-x86_64-2.7/pygraphviz/graphviz_wrap.o -L/usr/lib/python2.7/config -L/usr/lib -lcgraph -lcdt -lpython2.7 -o build/lib.cygwin-3.0.3-x86_64-2.7/pygraphviz/_graphviz.dll
  /usr/lib/gcc/x86_64-pc-cygwin/7.4.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lcgraph
  /usr/lib/gcc/x86_64-pc-cygwin/7.4.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lcdt
  collect2: error: ld returned 1 exit status
  error: command 'gcc' failed with exit status 1

有没有人在cygwin下有效安装了pygraphviz,你能告诉我安装时它在哪里找到这些头文件和库吗?

标签: cygwingraphvizpygraphviz

解决方案


推荐阅读