问题描述
我正在尝试制作一些 Networkx Graphviz 图.
I'm trying to make some Networkx Graphviz graphs.
运行后:pos = nx.graphviz_layout(G, prog = 'sfdp')
.发生错误,说:
After running: pos = nx.graphviz_layout(G, prog = 'sfdp')
. An error occured, saying:
Error: remove_overlap: Graphviz not built with triangulation library
经过 Google 研究后,我发现GTS是问题所在. 错误报告表示:
After some Google research I found that GTS is the problem. Bug report stated:
看着评论(关于bug报告),有人说 Graphviz 的上游资源保存在链接,但找不到要下载的新版本.
Looking at comments ( on bug report ), someone said that the upstream sources for Graphviz are kept at link but I couldn't find new versions to download.
在软件包列表中,我有最新的(对于 trusty,为2.36 ).
On package list I have the latest one (2.36 for trusty).
还有其他人对sfdp
有疑问吗?
Anyone else having problems with sfdp
?
任何帮助将不胜感激!
推荐答案
对于ubuntu用户,这是我让grapvhiz在16.04上工作的方式,从源代码编译graphviz-2.40.1:
For the ubuntu users, this is how I got grapvhiz to work on 16.04,compiling graphviz-2.40.1 from source:
第一步,需要安装 GTS ,因为graphviz会查找 gts.pc文件.
In a first step , GTS needs to be installed , as graphviz looks for the gts.pc file.
运行
apt-file search gts.pc
通知我我必须安装'libgts-dev':
Informs me I have to install 'libgts-dev' :
sudo apt install libgts-dev
下一步使pkg-config识别文件:
next make pkg-config aware of the files:
pkg-config --libs gts
pkg-config --cflags gts
运行配置链接到gts库:
run configure to link in the gts library:
./configure --with-gts --prefix ~
make
make install
SFDP不再引发错误错误:remove_overlap:Graphviz不是用三角剖分库构建的"
SFDP no longer throws the error 'Error: remove_overlap: Graphviz not built with triangulation library'
我从答案.
这篇关于Ubuntu graphviz'sfdp'无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!