cygwin - 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,你能告诉我安装时它在哪里找到这些头文件和库吗?
解决方案
推荐阅读
- python-3.x - 与协程的两种方式通信(asyncio 中的状态机)
- javascript - Ajax 在页面中发回后,Javascript 控制台命令不起作用
- ios - 滚动视图与集合视图。获取“可见图像”
- scala - 具有数组和映射数据类型的 Spark Scala 案例类
- javascript - Chrome 中的文件和目录条目 API 是否损坏?
- javascript - Lightbox2 突然无法在 Chrome 中运行
- python - google.cloud 在哪个 python 库中?
- python - 如何使用 pytest 模拟导入的模块
- c# - 使用 Moq 设置直到运行时才知道类型的泛型方法?
- c# - 我怎样才能“终止”一个无效的方法?