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

ipywidgets_bokeh not loading ipython #40

Open
Tracked by #91
ncvangilse opened this issue Oct 13, 2021 · 0 comments
Open
Tracked by #91

ipywidgets_bokeh not loading ipython #40

ncvangilse opened this issue Oct 13, 2021 · 0 comments

Comments

@ncvangilse
Copy link

When instantiating a MatplotlibPane in Panel, I get an attribute error.

import panel as pn
from matplotlib import pyplot as plt

fig, ax = plt.subplots()
ax.plot([0,1,2], [2,2,4])
pn.pane.plot.Matplotlib(fig, interactive=True).show()

Raises

...
  File "/home/jovyan/conda-envs/pmat/lib/python3.9/site-packages/panel/pane/plot.py", line 170, in _get_widget
    from ipympl.backend_nbagg import FigureManager, Canvas, is_interactive
  File "/home/jovyan/conda-envs/pmat/lib/python3.9/site-packages/ipympl/__init__.py", line 27, in <module>
    matplotlib.use('module://ipympl.backend_nbagg')
  File "/home/jovyan/conda-envs/pmat/lib/python3.9/site-packages/matplotlib/__init__.py", line 1080, in use
    plt.switch_backend(name)
  File "/home/jovyan/conda-envs/pmat/lib/python3.9/site-packages/matplotlib/pyplot.py", line 277, in switch_backend
    class backend_mod(matplotlib.backend_bases._Backend):
  File "/home/jovyan/conda-envs/pmat/lib/python3.9/site-packages/matplotlib/pyplot.py", line 278, in backend_mod
    locals().update(vars(importlib.import_module(backend_name)))
  File "/home/jovyan/conda-envs/pmat/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/jovyan/conda-envs/pmat/lib/python3.9/site-packages/ipympl/backend_nbagg.py", line 431, in <module>
    ip.events.register('post_execute', flush_figures)
AttributeError: 'NoneType' object has no attribute 'events'

I have tried implementing the pull request suggested in https://discourse.holoviz.org/t/matplotlib-pane-throwing-attributeerror-when-interactive-true/2911/6

but then I get errors:

ERROR:fake:Invalid Message
Traceback (most recent call last):
  File "C:\Users\nchvg\Miniconda3\envs\optisoil-engineering-tools\lib\site-packages\ipykernel\kernelbase.py", line 312, in dispatch_shell
    msg = self.session.deserialize(msg, content=True, copy=False)
  File "C:\Users\nchvg\Miniconda3\envs\optisoil-engineering-tools\lib\site-packages\jupyter_client\session.py", line 1048, in deserialize
    raise ValueError("Duplicate Signature: %r" % signature)
ValueError: Duplicate Signature: b'9b25b08aacbdc8c77ef9f91368742482787dd5afe83a7a6872bb7f3e1366b335'

Here is my env:

bokeh                     2.4.0            py38haa244fe_0    conda-forge
ipykernel                 6.4.1            py38h595d716_0    conda-forge
ipympl                    0.8.0              pyhd8ed1ab_0    conda-forge
ipython                   7.28.0           py38h595d716_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                7.6.5              pyhd8ed1ab_0    conda-forge
ipywidgets-bokeh          1.2.1                    pypi_0    pypi
jupyter_client            7.0.6              pyhd8ed1ab_0    conda-forge
jupyter_core              4.8.1            py38haa244fe_0    conda-forge
jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
jupyterlab_widgets        1.0.2              pyhd8ed1ab_0    conda-forge
@ndmlny-qs ndmlny-qs mentioned this issue Apr 6, 2023
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant