From 341bf0f5043aec3ae7a6cdf62eac3f3122fe525d Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 09:50:49 +0000 Subject: [PATCH] Improve mesage on failed Graphviz optional (#11896) (#12072) * 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) Co-authored-by: Jake Lishman --- 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 16a01a29d69e..f2b1e56e1120 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"),