Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graphviz dot not work on OS X Yosemite

Tags:

graphviz

dot

I have a dot file that I want to convert to a ps or png. Graphviz is installed with brew on OS X Yosemite. However, dot fails to convert with the following output:

Borkdude@macbookair-michiel /tmp $ dot -Tps foo.dot -o foo.ps
Format: "ps" not recognized. Use one of:

Where to look next?

like image 291
Michiel Borkent Avatar asked Dec 12 '15 13:12

Michiel Borkent


2 Answers

TL;DR

As this issue is most likely caused by a botched update or install, the most simple solution is to completely uninstall and then re-install Graphviz.

The Long Version

Check supported formats

The first thing to do is see what formats dot supports. Following the instructions from the manual, this is achieved by running:

dot -T?

This should output something along the lines of

Format: "?" not recognized. Use one of: bmp canon cgimage cmap cmapx cmapx_np dot 
eps exr fig gif gv icns ico imap imap_np ismap jp2 jpe jpeg jpg pct pdf pic pict 
plain plain-ext png pov ps ps2 psd sgi svg svgz tga tif tiff tk vml vmlz xdot 
xdot1.2 xdot1.4

Based on the output you're getting, ps will not be in that list.

Check config file

There is a bug report of a similar issue which suggest validating that a config file exists (mine was /usr/local/Cellar/graphviz/2.38.0/lib/graphviz/config6).

If it does exist, grep for ps to see if it is in fact mentioned in the config. If it is not, reinstall is required.

If it does not exist, run dot -c to create one.

Visit the forum

If this does not resolve the issue, the next step would be to go on the Graphviz Forum and ask for helpt there.

like image 99
Potherca Avatar answered Oct 16 '22 09:10

Potherca


I solved it using the following steps

  1. Uninstall graphviz using brew remove graphviz
  2. Install macports
  3. sudo port -v selfupdate sudo port install graphviz-gui
like image 34
Piyush Khera Avatar answered Oct 16 '22 09:10

Piyush Khera