gpt4 book ai didi

python - Jupyter笔记本电脑: Widget Javascript not detected

转载 作者:行者123 更新时间:2023-12-04 07:26:57 25 4
gpt4 key购买 nike

问题:
我在MacOs 10.9中使用pip3安装了python3和jupyter笔记本。
当我尝试运行窗口小部件时,它提示没有javascript窗口小部件。
我在Jupyter-notebook中安装了python3和R内核。

代码:

from ipywidgets import widgets
from IPython.display import display
text = widgets.Text()
display(text)
text.on_submit('hello')

错误:
Widget Javascript not detected.  It may not be installed or enabled properly.  

尝试次数:
sudo -H pip3 install ipywidgets  
sudo -H pip3 install -upgrade ipywidgets
jupyter nbextension enable --py widgetsnbextension
# restarted the computer.

最后一条命令给出错误。
[EnableNBExtensionApp] CRITICAL | Bad config encountered during initialization:
[EnableNBExtensionApp] CRITICAL | Unrecognized flag: '--py'

请注意,在Mac中,我有jupyter-nbextension命令,但该命令为:
jupyter-nbextension enable --py widgetsnbextension 

也不起作用。

但是 jupyter nbextension enable widgetsnbextension没有给出错误,也没有任何作用。如果我运行代码,则会弹出相同的错误。

还,
import ipywidgets
ipywidgets.__version__

给出“6.0.0”。

一些注意事项:
which jupyter  
jupyter is /Library/Frameworks/Python.framework/Versions/3.5/bin/jupyter
which jupyter-notebook
jupyter-notebook is /Library/Frameworks/Python.framework/Versions/3.5/bin/jupyter-notebook

相关链接:
https://github.com/jupyter-widgets/ipywidgets/issues/541    
https://github.com/jupyter/help/issues/32
https://github.com/jupyter/help/issues/131
https://github.com/binder-project/binder/issues/83

如何安装小部件?
我需要单独安装Java吗?

最佳答案

运行以下命令:jupyter nbextension enable --py --sys-prefix widgetsnbextension,然后在Jupyter中重新启动内核应该可以解决问题。

关于python - Jupyter笔记本电脑: Widget Javascript not detected,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43769068/

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