orchest / orchest

Build data pipelines, the easy way 🛠️

Home Page:https://orchest.readthedocs.io/en/stable/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ipywidgets gives `Model not found` errors

astrojuanlu opened this issue ¡ comments

Describe the feature you'd love to have in Orchest

It would be nice for Orchest to install ipywidgets on Jupyter by default.

Is your feature request related to a problem? Please describe.

Initially I was not able to make anything based on ipywidgets work, but then I realized I probably needed to install it globally for Jupyter, and not as part of a particular environment. That turned out to be the solution.

However, I don't think our average user will reach that conclusion so quickly.

Additional context

One alternative is just to document this better: for example, by adding a "Error displaying widget: model not found" entry to the FAQ. But both approaches are not mutually exclusive: we can add that entry to the FAQ anyway, and still install ipywidgets by default, which is quite common.

I remember implementing this back in the day, don't the following lines install ipywidgets for the user?

and

Sounds also like the approach that you took?

Looks like it, but at the same time doesn't seem to work.

To reproduce:

  1. Verify that the JupyterLab Configuration script is empty
  2. Create a new project and a new pipeline
  3. Add pip install ipywidgets in the setup script They are being preinstalled already
  4. Get to JupyterLab and do import ipywidgets as ipyw; ipyw.IntSlider()
  5. See Error displaying widget: model not found ❌
  6. Go back to JupyterLab configuration, add pip install ipywidgets
  7. Repeat import ipywidgets as ipyw; ipyw.IntSlider(), see the slider ✔️

Note: requirements-user.txt installs ipywidgets inside the environment (my step 4 from above, insufficient 👎🏽) and it doesn't seem like jupyterlab-widgets depends on ipywidgets.

I acknowledge that this procedure follows the official documentation though: https://ipywidgets.readthedocs.io/en/stable/user_install.html#installing-in-jupyterlab-3-x

I opened jupyter-widgets/ipywidgets#3577 to track this seemingly unexpected behavior upstream.

Confirmed that upgrading jupyterlab_widgets on the JupyterLab environment to 3.0 worked.

Mistery solved, PR incoming.

I'm noting though that this might cause some incompatibilities with ipympl... matplotlib/ipympl#460 (comment)

Repurposed gh-1242 to cap ipywidgets, instead of upgrading it. This still solves the issue while giving time for the ecosystem to adapt.