Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve mesage on failed Graphviz optional #11896

Merged
merged 2 commits into from
Mar 24, 2024

Conversation

jakelishman
Copy link
Member

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.

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.
@jakelishman jakelishman added documentation Something is not clear or an error documentation Changelog: None Do not include in changelog labels Feb 26, 2024
@jakelishman jakelishman requested a review from a team as a code owner February 26, 2024 16:27
@qiskit-bot
Copy link
Collaborator

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

@jakelishman
Copy link
Member Author

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."

@coveralls
Copy link

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%
Totals Coverage Status
Change from base Build 8052013397: 0.03%
Covered Lines: 59150
Relevant Lines: 66214

💛 - Coveralls

Copy link
Collaborator

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Jake! This is a solid improvement

@jakelishman jakelishman added this to the 1.1.0 milestone Mar 1, 2024
@1ucian0 1ucian0 added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Mar 24, 2024
@1ucian0
Copy link
Member

1ucian0 commented Mar 24, 2024

@Mergifyio backport stable/0.46

@1ucian0 1ucian0 added this pull request to the merge queue Mar 24, 2024
Copy link
Contributor

mergify bot commented Mar 24, 2024

backport stable/0.46

✅ Backports have been created

Merged via the queue into Qiskit:main with commit 17949dc Mar 24, 2024
12 checks passed
mergify bot pushed a commit that referenced this pull request Mar 24, 2024
* 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 17949dc)
mergify bot pushed a commit that referenced this pull request Mar 24, 2024
* 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 17949dc)
@jakelishman jakelishman deleted the graphviz-install-message branch March 24, 2024 21:54
github-merge-queue bot pushed a commit that referenced this pull request Mar 25, 2024
* 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 17949dc)

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
github-merge-queue bot pushed a commit that referenced this pull request Mar 28, 2024
* 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 17949dc)

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog documentation Something is not clear or an error documentation stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add graphviz to the visualization tool dependency
5 participants