11

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!

VlS
  • 586
  • 3
  • 13

3 Answers3

7

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.

CervEd
  • 3,306
  • 28
  • 25
Sam Windels
  • 71
  • 1
  • 4
  • 1
    Downloaded `graphviz-2.40.1.tar.gz` from [here](http://www.graphviz.org/Download_source.php) and ran through your procedure, and it works - sort of. I can use some commands (`dot`, `fdp`), but not others (`sfdp`, `neato`). Any idea what's going on here? (Using Ubuntu 16.04.2) ` –  May 04 '17 at 14:44
  • `/usr/bin/sfdp: No such file or directory` is the problem, btw. Whereas the other commands work just like normal. [This post](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853468) seems to agree with the above procedure answer (1. install `libgts-dev`, 2. add `--with-gts` to configuration). Anyone else out there having the same problem as me? –  May 04 '17 at 15:04
  • Okay, I got it working (no problems yet, at least) - for others who have similar troubles, I wrote some info here: https://github.com/ellson/graphviz/issues/1237 Though it was probably just something I did wrong. Thanks, Sam! –  May 05 '17 at 04:14
  • Hi @JoeRocc , sorry I did not see your comment. Glad you got it to work. – Sam Windels Jun 12 '17 at 08:10
6

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
Matthias Winkelmann
  • 15,870
  • 7
  • 64
  • 76
  • 1
    As of now, gts is one of the dependencies of graphviz, so simple reinstalling solves the problem. – Xun Jian Sep 13 '19 at 05:30
1

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.

Paul Smith
  • 454
  • 6
  • 11