首页 > 解决方案 > Jupyter-matplotlib:显示小部件时出错:找不到模型

问题描述

我正在尝试安装 jupyter-matplotlib 扩展,但无法使其在 jupyterlab 实例中工作。按照此处的步骤安装后:
https
://github.com/matplotlib/jupyter-matplotlib 执行一个简单示例时出现
错误:显示小部件时出错:找不到模型
所描述行为的屏幕截图

这是我$ conda list的相关软件包的输出:

ipykernel 5.1.1
ipympl 0.2.1
ipython 7.6.1
ipython_genutils 0.2.0
ipywidgets 7.5.0
jupyter_client 5.3.1
jupyter_core 4.4.0
jupyterlab 1.0.2
jupyterlab_server 1.0.0

标签: pythonmatplotlibjupyter

解决方案


解决了!结果 ipywidget 7.5 破坏了 jupyter lab,它也影响了其他库。

https://github.com/plotly/plotly.py/issues/1659

降级到 7 为我解决了这个问题(尽管 7 wrt 7.5 应该是向后兼容的)!

还要确保将 ipympl 0.2.1 与 jupyter-matplotlib 0.3.0 labextension 匹配。 jupyter labextension install jupyter-matplotlib@0.3.0


推荐阅读