我在新电脑上复制Jupyter Lab安装时遇到问题。它在我以前的电脑上运行良好。我无法显示简单的小部件(比如ipywidgets或ipyvutify中的复选框(。我检查了jupyter小部件是否已启用jupyter标签扩展列表。结果是:
jupyter-vue v1.7.0 enabled ok
jupyter-vuetify v1.8.4 enabled ok
@jupyter-widgets/jupyterlab-manager v5.0.2 enabled ok (python, jupyterlab_widgets)
在笔记本中,当我尝试显示小部件时,单元格显示Javascrip错误:
[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'CheckboxModel' from module '@jupyter-widgets/controls'
Error: Module @jupyter-widgets/controls, version ^1.5.0 is not registered, however,
2.0.0 is
at f.loadClass (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-
manager/static/134.083e6b37f2f7b2f04b5e.js?v=083e6b37f2f7b2f04b5e:1:74976)
at f.loadModelClass (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-
manager/static/150.467514c324d2bcc23502.js?v=467514c324d2bcc23502:1:10721)
at f._make_model (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-
manager/static/150.467514c324d2bcc23502.js?v=467514c324d2bcc23502:1:7517)
at f.new_model (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-
manager/static/150.467514c324d2bcc23502.js?v=467514c324d2bcc23502:1:5137)
at f.handle_comm_open (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-
manager/static/150.467514c324d2bcc23502.js?v=467514c324d2bcc23502:1:3894)
at _handleCommOpen (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-
manager/static/134.083e6b37f2f7b2f04b5e.js?v=083e6b37f2f7b2f04b5e:1:73392)
at b._handleCommOpen (http://localhost:8888/static/lab/jlab_core.86360d749a1ef5f29afb.js?
v=86360d749a1ef5f29afb:2:924842)
at async b._handleMessage
(http://localhost:8888/static/lab/jlab_core.86360d749a1ef5f29afb.js?
v=86360d749a1ef5f29afb:2:926832)
该错误与最近一份问题报告中提到的错误一致。建议更改为ipywidgets版本7.7.2或7.6.5以解决此问题。另外,请参阅此处的注释。
当我的ipywidgets版本是7.6.5时,我遇到了同样的问题。在我将ipywidget版本更新到8.0.4后,问题得到了解决。
我在mybinder.com上执行笔记本时遇到了这个问题。environment.yml文件包含:
通道:
- conda锻造厂
依赖项:
- python=3.8.8
- jupyter=1.0.0
- jupytelab=3.0.14
- ipywidgets=7.5.1
- matplotlib=3.4.1
- numpy=1.20.2
- scipy=1.6.2
- 熊猫=1.2.4
运行
pip安装ipympl==0.9.3
或
conda install ipympl=0.9.3
终端或控制台中的
为我解决了问题。
我想在Waynes答案下发表评论,但我做不到,所以就在这里。我在8.0.6时也遇到了同样的问题我降到了8.0.4,然后就成功了!
我遇到了类似的错误消息,启用了相关的jupyter扩展并重新启动内核解决了问题。
jupyter nbextension enable --py widgetsnbextension
你可以在这里找到详细的说明