'Unable to execute dot command after installation of Graphviz. (There is no layout engine support for "dot")

I'm working on a Ubuntu system and installed the Graphviz library with:

sudo apt install graphviz

As dot comes with it by default when I'm running the dot command, it gives me:

There is no layout engine support for "dot"
Perhaps "dot -c" needs to be run (with installer's privileges) to register the plugins?

Or when I run the whole command like:

dot -Tsvg test.gv -O

This produces below error:

Format: "svg" not recognized. No formats found.
Perhaps "dot -c" needs to be run (with installer's privileges) to register the plugins?

I tried the command given here in the terminal dot -c/sudo dot -c but didn't work for me. Also, search for the solution of it, which ends up with the same answer, which is to use dot -c.

I tried reinstalling it several times but ends up with the same error. I used Graphviz previously as well without any problem. Don't know if I'm missing something this time.

So, How can I resolve this?



Solution 1:[1]

For what it's worth, I had the exact same errors on MacOS using homebrew to install graphviz. It seems like this problem is caused by a missing dependency, although there is not good feedback on what exactly is missing.

These commands (again, Mac - not your platform but context may be helpful) fixed it for me:

brew install libtool
brew link libtool
brew install graphviz
brew link --overwrite graphviz

Specifically, I don't think libtool was installed/linked correctly.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Garrett Sutula