Graphviz's dot: PNG not recognized
This is a post not only to relieve some frustration, but also to help some other poor fellow with this problem as I think it will inevitably crop up.
I just wanted acyclic graphs in my Sphinx documents. That was it.
So, I installed Graphviz with Brew, expecting it to work... But no:
~ $ dot -Tpng Format: "png" not recognized. Use one of: canon cmap cmapx cmapx_np dot eps fig gv imap imap_np ismap plain plain-ext ps ps2 svg svgz tk vml vmlz xdot
I installed it on my own. I varied the configuration. Everything. I searched mailing lists. Then, I found a discussion saying Graphviz cannot be relocated without running dot -c -- hmm:
~ $ sudo dot -c Warning: Could not load "/usr/local/Cellar/graphviz/2.26.3/lib/graphviz/libgvplugin_gd.6.dylib" - file not found Warning: Could not load "/usr/local/Cellar/graphviz/2.26.3/lib/graphviz/libgvplugin_gd.6.dylib" - file not found ~ $ ls "/usr/local/Cellar/graphviz/2.26.3/lib/graphviz/libgvplugin_gd.6.dylib" /usr/local/Cellar/graphviz/2.26.3/lib/graphviz/libgvplugin_gd.6.dylib
What? It's right there for f---'s sake!
I even did an otool -l on the file in question, to see that the shared libraries it loaded were in the correct places, and they were!
So, my last effort, a shot in the dark: load it with ctypes, see what it says. After tearing out the hair on my skull, this:
/usr/local/Cellar/graphviz/2.26.3 $ python Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes >>> ctypes.CDLL('/usr/local/Cellar/graphviz/2.26.3/lib/graphviz/libgvplugin_gd.6.dylib') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/__init__.py", line 345, in __init__ self._handle = _dlopen(self._name, mode) OSError: dlopen(/usr/local/Cellar/graphviz/2.26.3/lib/graphviz/libgvplugin_gd.6.dylib, 6): Library not loaded: /opt/local/lib/libiconv.2.dylib Referenced from: /usr/local/Cellar/gd/2.0.36RC1/lib/libgd.2.dylib Reason: Incompatible library version: libgd.2.dylib requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0 >>>
Why the fork didn't it just tell me that instead?
The solution of course is to rebuild GD since it links against a libiconv that not only is outdated, but has also been removed.