相关疑难解决方法(0)

如何克服“错误:在注册表中找不到对象‘jupyter.widget’”?

我在 kubernetes 上的 jupyterhub 中运行 jupyterlab。

我正在尝试使用例如显示小部件

from ipywidgets import interact

@interact(x=(0, 100, 10))
def p(x=50):
    pass
Run Code Online (Sandbox Code Playgroud)

实验室笔记本打印的不是预期的交互式小部件:

interactive(children=(IntSlider(value=50, description='x', step=10), Output()), _dom_classes=('widget-interact...
Run Code Online (Sandbox Code Playgroud)

检查 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)
Run Code Online (Sandbox Code Playgroud)

我尝试了许多不同的组合:

!pip install ipywidgets
!pip install widgetsnbextension --upgrade
!pip install widgetslabextension --upgrade
!conda install -n base …
Run Code Online (Sandbox Code Playgroud)

python jupyter-notebook jupyterhub ipywidgets jupyter-lab

6
推荐指数
1
解决办法
8960
查看次数