I am running jupyterlab within jupyterhub on kubernetes.
I am trying to display widgets using e.g.
from ipywidgets import interact
@interact(x=(0, 100, 10))
def p(x=50):
pass
Instead of the intended interactive widget, the lab notebook prints:
interactive(children=(IntSlider(value=50, description='x', step=10), Output()), _dom_classes=('widget-interact...
On inspection of the javascript console:
default.js:129 Error: Object 'jupyter.widget' not found in registry
at default.js:1474
at new Promise (<anonymous>)
at Object.loadObject (default.js:1453)
at DefaultKernel.<anonymous> (default.js:919)
at Generator.next (<anonymous>)
at default.js:9
at new Promise (<anonymous>)
at push.YC29.__awaiter (default.js:5)
at DefaultKernel._handleCommOpen (default.js:911)
at DefaultKernel.<anonymous> (default.js:1018)
I have tried many different combinations of:
!pip install ipywidgets
!pip install widgetsnbextension --upgrade
!pip install widgetslabextension --upgrade
!conda install -n base -y --override-channels -c main -c conda-forge widgetsnbextension ipywidgets nodejs
!jupyter nbextension enable --py widgetsnbextension
!jupyter labextension enable widgetsnbextension
!jupyter labextension list
!jupyter labextension install @jupyter-widgets/jupyterlab-manager
!jupyter lab clean
!jupyter lab build
!pip install --upgrade Nodejs
!npm install -g npm yarn
!jupyter serverextension enable --py jupyterlab --sys-prefix
jupyterlab is at 1.0.0 and jupyterlab-manager is at 1.0.
Once everything is in order, how do I propagate changes?
NB If I restart jupyterlab the container restarts and all changes are lost.
I will do anything - print versions, pip freeze, run tests, reformat/reword this question.
Does anyone have a remote clue how to resolve this?
Please help!
The following did not help:
How to get ipywidgets working in Jupyter Lab?
https://ipywidgets.readthedocs.io/en/latest/user_install.html#installing-the-jupyterlab-extension
Problem displaying widgets / ipywidgets install unsuccessful
https://github.com/jupyter-widgets/ipywidgets/issues/2220
https://github.com/jupyter-widgets/ipywidgets/issues/2514
https://github.com/jupyter-widgets/ipywidgets/issues/2483
https://github.com/twosigma/beakerx/issues/7520
https://github.com/jupyterlab/jupyterlab/issues/6998
https://jupyterhub.readthedocs.io/en/stable/troubleshooting.html
jupyter/scipy-notebook
Docker image and everything broke, with an error in the browser console e.g...main.abf319f10d4c4ee43bc1.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff)
– Modulator