gpt4 book ai didi

widget - Jupyter 小部件未出现在笔记本中

转载 作者:行者123 更新时间:2023-12-03 13:33:23 27 4
gpt4 key购买 nike

我正在运行 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 笔记本之前。你尝试执行吗?:

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使用 pip 显示安装说明。指定在使用虚拟环境时使用此模式。
enter image description here

关于widget - Jupyter 小部件未出现在笔记本中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47396512/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com