Repository navigation
Description
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
ianhi commentedon Feb 24, 2021
Indeed
Gcf._activeQueno longer seems to exist in https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/_pylab_helpers.pyThat 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) .
ianhi commentedon Feb 24, 2021
The fix is probably to take the current version from the nbagg backend which can be found here: https://github.com/matplotlib/matplotlib/blob/a510e32a37a8b4e0bc4e8384df20c7b45abd9913/lib/matplotlib/backends/backend_nbagg.py#L246
ianhi commentedon Feb 24, 2021
I realized why I couldn't reproduce, I was misled by the
drawin the traceback. A small reproduction case is:ianhi commentedon Feb 24, 2021
As a workarond @kthare10 you can set set interactive mode to true with
plt.ion()and the error should be resolved.ianhi commentedon Mar 1, 2021
@kthare10 see #305 for a fix
kthare10 commentedon Mar 1, 2021
Thanks! Appreciate it!