Ubuntu graphviz 'sfdp' not working

那年仲夏 提交于 2019-12-10 02:25:37

问题


I'm trying to make some Networkx Graphviz graphs.

After running: pos = nx.graphviz_layout(G, prog = 'sfdp'). An error occured, saying:

Error: remove_overlap: Graphviz not built with triangulation library

After some Google research I found that GTS is the problem. Bug report stated:

The Graphviz package is built --without-gts. This is bad news for sfdp, which complains “Error: remove_overlap: Graphviz not built with triangulation library” and fails to produce the beautiful output it creates when compiled --with-gts

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.

On package list I have the latest one (2.36 for trusty).

Anyone else having problems with sfdp?

Any help will be greatly appreciated!


回答1:


I know the question is for Ubuntu, but in case someone is having the same problem on macOS using homebrew the following worked for me:

brew reinstall graphviz --with-gts



回答2:


For the ubuntu users, this is how I got grapvhiz to work on 16.04,compiling graphviz-2.40.1 from source:

In a first step , GTS needs to be installed , as graphviz looks for the gts.pc file.

Running

apt-file search gts.pc

Informs me I have to install 'libgts-dev' :

sudo apt install libgts-dev

next make pkg-config aware of the files:

pkg-config --libs gts

pkg-config --cflags gts

run configure to link in the gts library:

./configure --with-gts  --prefix ~
make
make install

SFDP no longer throws the error 'Error: remove_overlap: Graphviz not built with triangulation library'

The command line codes for the pkg config I modified from this answer.




回答3:


I might have it working for Ubuntu 14.04, YMMV

Download the following graphviz packages directly from https://packages.debian.org/search?keywords=graphviz

  • graphviz_2.38.0-13_amd64.deb
  • libcgraph6_2.38.0-13_amd64.deb
  • libgvc6_2.38.0-13_amd64.deb
  • libgvpr2_2.38.0-13_amd64.deb
  • libltdl7_2.4.6-0.1_amd64.deb
  • python-pygraphviz_1.3.1-1_amd64.deb

I used version 2.38.0-13 from the stretch(testing) group. You will need to remove the 32bit libltdl7 if present:

sudo apt-get remove libltdl7:i386

Install the packages directly with

sudo dpkg -i graphviz_2.38.0-13_amd64.deb    
sudo dpkg -i libcgraph6_2.38.0-13_amd64.deb libgvc6_2.38.0-13_amd64.deb libgvpr2_2.38.0-13_amd64.deb libltdl7_2.4.6-0.1_amd64.deb

You can expect dependency errors. I cleared them with:

sudo apt-get install -f

And then re-install

sudo dpkg -i graphviz_2.38.0-13_amd64.deb
sudo dpkg -i python-pygraphviz_1.3.1-1_amd64.deb

The error no longer appeares though I would be hard pushed to say the graphs are any better.



来源:https://stackoverflow.com/questions/34228395/ubuntu-graphviz-sfdp-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!