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

v0.9.0 breaks Output rendering in voila #463

Closed
marcelmindemann opened this issue Apr 21, 2022 · 11 comments
Closed

v0.9.0 breaks Output rendering in voila #463

marcelmindemann opened this issue Apr 21, 2022 · 11 comments

Comments

@marcelmindemann
Copy link

Describe the issue

Using an ipywidgets.Output to capture some ipympl plots, then displaying the Output in Voila shows only "Loading Widget...". Works with ipympl 0.8.8.

Minimal code example:

import matplotlib.pyplot as plt
import ipywidgets as widgets

%matplotlib widget
o = widgets.Output()

with o:
    plt.plot([1, 2, 3, 4])
    plt.ylabel('some numbers')
    plt.show()
    
o

Works in JupyterLab 3.3.0:
Screen Shot 2022-04-21 at 15 50 33

Does not work in voila + ipympl 0.9.0:
Screen Shot 2022-04-21 at 15 50 39

Works in voila + ipympl 0.8.8:
Screen Shot 2022-04-21 at 15 51 33

Versions

 3.9.10 (main, Feb  2 2022, 16:22:02) 
[Clang 13.0.0 (clang-1300.0.29.30)]
ipympl version: 0.8.8

Selected Jupyter core packages...
IPython          : 8.2.0
ipykernel        : 6.13.0
ipywidgets       : 7.7.0
jupyter_client   : 7.2.2
jupyter_core     : 4.10.0
jupyter_server   : 1.16.0
jupyterlab       : 3.3.4
nbclient         : 0.5.13
nbconvert        : 6.5.0
nbformat         : 5.3.0
notebook         : 6.4.11
qtconsole        : not installed
traitlets        : 5.1.1
Known nbextensions:
  config dir: /Users/marcel.mindemann/moia-dev/pooling-analytics/passt/discovery-panel/.venv/etc/jupyter/nbconfig
    notebook section
      jupyter-leaflet/extension  enabled 
      - Validating: OK
      jupyter-matplotlib/extension  enabled 
      - Validating: OK
      jupyterlab-plotly/extension  enabled 
      - Validating: OK
      voila/extension  enabled 
      - Validating: OK
      jupyter-js-widgets/extension  enabled 
      - Validating: OK
JupyterLab v3.3.4
/Users/marcel.mindemann/moia-dev/pooling-analytics/passt/discovery-panel/.venv/share/jupyter/labextensions
        jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
        jupyter-matplotlib v0.10.5 enabled OK
        jupyter-leaflet v0.16.0 enabled OK
        jupyterlab-plotly v5.7.0 enabled OK
        @pyviz/jupyterlab_pyviz v2.2.0 enabled OK (python, pyviz_comms)
        @voila-dashboards/jupyterlab-preview v2.1.5 enabled OK (python, voila)
        @jupyter-widgets/jupyterlab-sidecar v0.6.1 enabled OK (python, sidecar)
        @jupyter-widgets/jupyterlab-manager v3.1.0 enabled OK (python, jupyterlab_widgets)
@martinRenou
Copy link
Member

martinRenou commented Apr 21, 2022

Can you try uninstalling ipympl, then removing the /Users/marcel.mindemann/moia-dev/pooling-analytics/passt/discovery-panel/.venv/share/jupyter/labextensions/jupyter-matplotlib directory entirely and install ipympl v0.9.0 again?

Starting from this release, updating ipympl should be less painful.

@martinRenou
Copy link
Member

@ianhi I can also reproduce this issue. Latest ipympl seems to not work with Voila.

I guess the issue is with the package version number. Voila seems to be trying to download jupyter-matplotlib 1.0.0 instead of 0.11.0:

Falling back to https://cdn.jsdelivr.net/npm/ for [email protected]

@ianhi
Copy link
Collaborator

ianhi commented Apr 21, 2022

Is that maybe a bug in voila and it's widget manager?

@ianhi
Copy link
Collaborator

ianhi commented Apr 21, 2022

I wonder why this doesn't happen for ipywidgets though. As far as I can see we've done the same thing as is done there

@martinRenou
Copy link
Member

Apparently there is the same issue with nbpshinx (which uses the ipywidgets HTMLManager) #462

You can see in this issue's screenshots the same thing:

Falling back to https://cdn.jsdelivr.net/npm/ for [email protected]

@martinRenou
Copy link
Member

It's unclear to me now how Voila/nbsphinx are supposed to know which jupyter-matplotlib version they need to download if that version is not part of the Python model... So this error makes sense.

@martinRenou
Copy link
Member

@martinRenou
Copy link
Member

I guess our only solution is to revert #448 :( I am so sorry

@martinRenou
Copy link
Member

It looks like if we want to implement #448 properly we need to update ipywidgets first

@DonJayamanne
Copy link

similar problem in vscode as well microsoft/vscode-jupyter#9697
@martinRenou let me know if there's anything we need to do to get this fixed in vscode extension. thanks.

@martinRenou
Copy link
Member

0.9.1 should fix this issue. I will mark the 0.9.0 release as broken on conda-forge.

@ianhi I reverted your changes on the widget versioning, again I am sorry for this. Though I've loosen a bit the back-end/front-end relationship by requiring ^0.11 instead of ^0.11.1, see https://github.com/matplotlib/ipympl/blob/main/ipympl/_version.py#L3.

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

4 participants