qiskit
qiskit copied to clipboard
Improve mesage on failed Graphviz optional
Summary
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.
Details and comments
Fix #11865, also a couple more messages I've seen on the public Qiskit slack.
One or more of the the following people are requested to review this:
-
@Qiskit/terra-core
fwiw, the new failure looks like this:
In [1]: from qiskit.utils import optionals
...:
...: with optionals.HAS_GRAPHVIZ.disable_locally():
...: optionals.HAS_GRAPHVIZ.require_now("test")
...:
---------------------------------------------------------------------------
MissingOptionalLibraryError Traceback (most recent call last)
Cell In[1], line 4
1 from qiskit.utils import optionals
3 with optionals.HAS_GRAPHVIZ.disable_locally():
----> 4 optionals.HAS_GRAPHVIZ.require_now("test")
File ~/code/qiskit/terra/qiskit/utils/lazy_tester.py:221, in LazyDependencyManager.require_now(self, feature)
219 if self:
220 return
--> 221 raise MissingOptionalLibraryError(
222 libname=self._name, name=feature, pip_install=self._install, msg=self._msg
223 )
MissingOptionalLibraryError: "The 'Graphviz' library is required to use 'test'. 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."
Pull Request Test Coverage Report for Build 8052272041
Details
- 0 of 0 changed or added relevant lines in 0 files are covered.
- 4 unchanged lines in 2 files lost coverage.
- Overall coverage increased (+0.03%) to 89.332%
Files with Coverage Reduction | New Missed Lines | % |
---|---|---|
crates/qasm2/src/expr.rs | 1 | 93.81% |
crates/qasm2/src/lex.rs | 3 | 91.94% |
<!-- | Total: | 4 |
Totals | |
---|---|
Change from base Build 8052013397: | 0.03% |
Covered Lines: | 59150 |
Relevant Lines: | 66214 |
💛 - Coveralls
@Mergifyio backport stable/0.46
backport stable/0.46
✅ Backports have been created
-
#12071 Improve mesage on failed Graphviz optional (backport #11896) has been created for branch
stable/0.46