Skip to content

ipympl version 0.6.3 is incompatible with matplotlib 3.3.4 #303

Closed

Description

@kthare10

Describe the issue

ipympl version 0.6.3 is incompatible with matplotlib 3.3.4

Exception

draw() throws an exception shown below when trying to access _activeQue in matplotlib/_pylab_helpers.py. This member only exists in matplotlib version 3.2.2 and has been removed in version 3.3.*

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-a2dfa485d491> in <module>
      7 t.nodes['n2'].add_component(ctype=fu.ComponentType.SharedNIC, model='ConnectX-6', name='nic2')
      8 t.add_link(name='l1', interfaces=list(t.interfaces.values()), ltype=fu.LinkType.Wave)
----> 9 t.draw()
     10 t.draw(topo_detail=fu.TopologyDetail.Derived)
/opt/conda/lib/python3.8/site-packages/fim/user/topology.py in draw(self, file_name, interactive, topo_detail, layout)
    300             nx.draw_networkx(derived_graph, pos=pos)
    301             if not interactive:
--> 302                 plt.show()
    303             if file_name is not None:
    304                 plt.savefig(file_name)
/opt/conda/lib/python3.8/site-packages/matplotlib/pyplot.py in show(*args, **kwargs)
    351     """
    352     _warn_if_gui_out_of_main_thread()
--> 353     return _backend_mod.show(*args, **kwargs)
    354 
    355 
/opt/conda/lib/python3.8/site-packages/ipympl/backend_nbagg.py in __call__(self, block)
     54                 manager.canvas.mpl_disconnect(manager._cidgcf)
     55 
---> 56             if not interactive and manager in Gcf._activeQue:
     57                 Gcf._activeQue.remove(manager)
     58 
AttributeError: type object 'Gcf' has no attribute '_activeQue'

Versions

python -c "import sys; print('\n',sys.version); import ipympl; print('ipympl version:', ipympl.version)" && jupyter --version && jupyter nbextension list && jupyter labextension list
3.8.6 | packaged by conda-forge | (default, Dec 26 2020, 05:05:16)
[GCC 9.3.0]
ipympl version: 0.6.3
jupyter core : 4.7.1
jupyter-notebook : 6.2.0
qtconsole : not installed
ipython : 7.20.0
ipykernel : 5.4.2
jupyter client : 6.1.11
jupyter lab : 3.0.5
nbconvert : 6.0.7
ipywidgets : 7.6.3
nbformat : 5.1.2
traitlets : 5.0.5
Known nbextensions:
config dir: /opt/conda/etc/jupyter/nbconfig
notebook section
jupyter-matplotlib/extension enabled
- Validating: OK
nbresuse/main enabled
- Validating: OK
jupyter-js-widgets/extension enabled
- Validating: OK
JupyterLab v3.0.5
/opt/conda/share/jupyter/labextensions
jupyter-matplotlib v0.8.3 enabled OK
@jupyter-widgets/jupyterlab-manager v3.0.0 enabled OK (python, jupyterlab_widgets)

Other labextensions (built into JupyterLab)
app dir: /opt/conda/share/jupyter/lab
jupyterlab-sos v0.8.0 enabled OK
transient-display-data v0.4.1 enabled OK

Activity

  1. ianhi commented on Feb 24, 2021

    @ianhi
    Collaborator

    Indeed Gcf._activeQue no longer seems to exist in https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/_pylab_helpers.py

    That said I wasn't able to replicate the error. @kthare10 can you please post a small complete test case that causes this error?(it should contain all necessary imports etc) .

  2. ianhi commented on Feb 24, 2021

    @ianhi
    Collaborator
  3. ianhi commented on Feb 24, 2021

    @ianhi
    Collaborator

    I realized why I couldn't reproduce, I was misled by the draw in the traceback. A small reproduction case is:

    %matplotlib ipympl
    import matplotlib.pyplot as plt
    plt.ioff()
    plt.figure()
    plt.show()
    
  4. ianhi commented on Feb 24, 2021

    @ianhi
    Collaborator

    As a workarond @kthare10 you can set set interactive mode to true with plt.ion() and the error should be resolved.

  5. ianhi commented on Mar 1, 2021

    @ianhi
    Collaborator

    @kthare10 see #305 for a fix

  6. kthare10 commented on Mar 1, 2021

    @kthare10
    Author

    Thanks! Appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions