From b34a3f2772394e508a06f70db6ae48c8be0f3b13 Mon Sep 17 00:00:00 2001 From: Jake Lishman Date: Sun, 24 Mar 2024 20:57:45 +0000 Subject: [PATCH] Improve mesage on failed Graphviz optional (#11896) * Improve mesage on failed Graphviz optional I have recently seen several users struggle to install a complete version of Graphviz upon seeing the `MissingOptionalLibraryError` message. This updates the message to make it clearer that the PyPI distribution `graphviz` *is not* the actual Graphviz software, and it must be installed separately. * Tweak message (cherry picked from commit 17949dc228bca54d01ff9a16b8c93e2eb690bf69) --- qiskit/utils/optionals.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qiskit/utils/optionals.py b/qiskit/utils/optionals.py index ba0b8d8fc1f..7f399094bb6 100644 --- a/qiskit/utils/optionals.py +++ b/qiskit/utils/optionals.py @@ -307,8 +307,12 @@ HAS_GRAPHVIZ = _LazySubprocessTester( ("dot", "-V"), - name="graphviz", - install="'brew install graphviz' if on Mac, or by downloding it from their website", + name="Graphviz", + msg=( + "To install, follow the instructions at https://graphviz.org/download/." + " Qiskit needs the Graphviz binaries, which the 'graphviz' package on pip does not install." + " You must install the actual Graphviz software" + ), ) HAS_PDFLATEX = _LazySubprocessTester( ("pdflatex", "-version"),