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:
- Verify that the JupyterLab Configuration script is empty
- Create a new project and a new pipeline
AddThey are being preinstalled alreadypip install ipywidgets
in the setup script- Get to JupyterLab and do
import ipywidgets as ipyw; ipyw.IntSlider()
- See
Error displaying widget: model not found
â - Go back to JupyterLab configuration, add
pip install ipywidgets
- 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.