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

Terra incompatible with matplotlib==3.5.0 #7272

Closed
jakelishman opened this issue Nov 16, 2021 · 3 comments · Fixed by #7301
Closed

Terra incompatible with matplotlib==3.5.0 #7272

jakelishman opened this issue Nov 16, 2021 · 3 comments · Fixed by #7301
Assignees
Labels
bug Something isn't working priority: high
Milestone

Comments

@jakelishman
Copy link
Member

Environment

  • Qiskit Terra version: 0.19.0.dev @ 7e118e8
  • Python version: 3.7+
  • Operating system: any

What is happening?

CI is currently failing on all docs and Linux 3.7 builds (only this one because the image tests are in it).

The docs failure is:

Extension error:
Cell raised uncaught exception:
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
~/work/1/s/.tox/docs/lib/python3.7/site-packages/IPython/core/formatters.py in __call__(self, obj)
    339                 pass
    340             else:
--> 341                 return printer(obj)
    342             # Finally look for special method names
    343             method = get_real_method(obj, self.print_method)

~/work/1/s/.tox/docs/lib/python3.7/site-packages/IPython/core/pylabtools.py in <lambda>(fig)
    437 
    438             collections_and_patches = (

AttributeError: 'Arrow3D' object has no attribute 'do_3d_projection'

and the Linux py3.7 failure is:

ERROR: test_plot_state_qsphere (mpl.graph.test_graph_matplotlib_drawer.TestGraphMatplotlibDrawer)
test for plot_state_qsphere
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vsts/work/1/s/test/ipynb/mpl/graph/test_graph_matplotlib_drawer.py", line 139, in test_plot_state_qsphere
    self.graph_state_drawer(state=state, output="qsphere", filename="qsphere.png")
  File "/home/vsts/work/1/s/test/ipynb/mpl/graph/test_graph_matplotlib_drawer.py", line 84, in wrapper
    results = func(*args, **kwargs)
  File "/home/vsts/work/1/s/qiskit/visualization/state_visualization.py", line 1433, in state_drawer
    return draw_func(state, **drawer_args)
  File "/home/vsts/work/1/s/qiskit/utils/deprecation.py", line 27, in wrapper
    return func(*args, **kwargs)
  File "/home/vsts/work/1/s/qiskit/visualization/state_visualization.py", line 961, in plot_state_qsphere
    return fig.savefig(filename)
  File "/home/vsts/work/1/s/image_tests/lib/python3.7/site-packages/matplotlib/figure.py", line 3012, in savefig
    self.canvas.print_figure(fname, **kwargs)
  File "/home/vsts/work/1/s/image_tests/lib/python3.7/site-packages/matplotlib/_api/__init__.py", line 299, in warn_external
    warnings.warn(message, category, stacklevel)
matplotlib._api.deprecation.MatplotlibDeprecationWarning: The 'renderer' parameter of do_3d_projection() was deprecated in Matplotlib 3.4 and will be removed two minor releases later.

How can we reproduce the issue?

Check a recent CI run.

What should happen?

No error.

Any suggestions?

Immediately, pin matplotlib<3.5 to get CI rolling, then work on fixing compatibility.

@jakelishman
Copy link
Member Author

The py3.7 failure is related to this message in the MPL deprecations, though that's from 3.4, so not certain why it's just appearing now.

@mtreinish mtreinish added this to the 0.19 milestone Nov 16, 2021
@mtreinish
Copy link
Member

I'm tagging this as 0.19.0 because we should try to come up with a fix for this before we release. Shipping packages with upper caps on requirements (even optional ones) is potentially problematic for users

@jakelishman jakelishman changed the title CI broken with matplotlib==3.5.0 Terra incompatible with matplotlib==3.5.0 Nov 16, 2021
@jakelishman jakelishman self-assigned this Nov 16, 2021
@mergify mergify bot closed this as completed in #7301 Nov 23, 2021
@ironfrown
Copy link

I had a similar problem with Qiskit Terra version: 0.19.1, Python 3.8.1 and matplotlib 3.5.1, which resulted in Qiskit crashing in "plot_state_qsphere" (again in Arrow3D object). The issue was resolved by updating matplotlib-inline to version 0.1.3 (from version 0.1.2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants