我正在运行 jupyter 笔记本,但 jupyter 小部件没有出现。相反,我收到以下消息:
Failed to display Jupyter Widget of type Button.
If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions.
If you're reading this message in another frontend (for example, a static rendering on GitHub or NBViewer), it may mean that your frontend doesn't currently support widgets.
我有以下版本:
widgetsnbextension (3.0.8)
ipywidgets (7.0.5)
我使用以下命令安装了小部件:
pip install ipywidgets
jupyter nbextension enable --py widgetsnbextension
我的代码也是:
import ipywidgets as widgets
from IPython.display import display
button = widgets.Button(description='Hello')
display(button)
我有相同的版本,代码适合我。
在启动 Jupyter Notebook 之前。你尝试执行吗?:
jupyter nbextension enable --py widgetsnbextension --sys-prefix
输出==>
Enabling notebook extension jupyter-js-widgets/extension...
- Validating: ok
** http://ipywidgets.readthedocs.io/en/stable/user_install.html http://ipywidgets.readthedocs.io/en/stable/user_install.html使用 pip 显示安装说明。指定在使用虚拟环境时使用此模式。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)