If a filename without extension is passed to the function dag_drawer, this line reports two errors:
nxpd.pydot.InvocationException: Program terminated with status: 1. stderr follows: Format: "XXXXX" not recognized. Use one of: ......
During handling of the above exception, another exception occurred:
qiskit.visualization.exceptions.VisualizationError: 'dag_drawer requires GraphViz installed in the system. Check https://www.graphviz.org/download/ for details on how to install GraphViz in your system.'
This is confusing because the second error thrown by Qiskit is not the cause of the problem.
Try dag_drawer(dag, filename='abc')
Make the error catching better.
We could either catch this error by reading and filtering the error message, or we could check the existence of the filename's extension, and provide a default one.
Hi @we-taper , thanks for reporting, and I agree the conflicting error messages are confusing. It looks like the error catching around https://github.com/Qiskit/qiskit-terra/blob/d090eca91dc1afdb68f563885c4ccf13b31de20e/qiskit/visualization/dag_visualization.py#L91 could be refined to either inspect the raised nxpd.pydot.InvocationException to try to determine the cause of the error, or at least include the generated stderr in the VisualizationError that's raised by qiskit.
Hi @kdk, I see you started working on this problem a couple of days ago... I was wondering if you're still on it or if I could try my hand at fixing this bug as well :)
I can have a look!