我在 kubernetes 上的 jupyterhub 中运行 jupyterlab。
我正在尝试使用例如显示小部件
from ipywidgets import interact
@interact(x=(0, 100, 10))
def p(x=50):
pass
实验室笔记本打印的不是预期的交互式小部件:
interactive(children=(IntSlider(value=50, description='x', step=10), Output()), _dom_classes=('widget-interact...
检查 javascript 控制台时:
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)
我尝试了许多不同的组合:
!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 的版本为 1.0.0,jupyterlab-manager 的版本为 1.0。
一旦一切就绪,我如何传播更改?
注意:如果我重新启动 jupyterlab,容器将重新启动并且所有更改都会丢失。
我会做任何事情 - 打印版本、pip freeze、运行测试、重新格式化/重写这个问题。
有谁知道如何解决这个问题?
请帮忙!
以下内容没有帮助:
如何让 ipywidgets 在 Jupyter Lab 中工作?
https://ipywidgets.readthedocs.io/en/latest/user_install.html#installing-the-jupyterlab-extension
显示小部件时出现问题/ipywidgets 安装失败
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
https://github.com/jupyter-widgets/ipywidgets/issues/1949
https://github.com/jupyter-widgets/ipywidgets/pull/1962