Skip to content

Commit

Permalink
Improve mesage on failed Graphviz optional (#11896)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jakelishman committed Mar 24, 2024
1 parent b14f3b5 commit 17949dc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions qiskit/utils/optionals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit 17949dc

Please sign in to comment.