问题:
我在MacOs 10.9上使用pip3安装了python3和jupyter notebook。
当我尝试运行小部件时,它显示没有JavaScript小部件的错误。
我在Jupyter-notebook中安装了python3和R内核。
代码:
最后一个命令出错了。
请注意,在Mac上我有jupyter-nbextension命令,但是这个命令:
给出'6.0.0'。
一些注意事项:
相关链接:
如何安装小部件? 我需要单独安装Java吗?
代码:
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吗?