我正在使用Jupyter来运行我的代码。
from Ipython.html.widgets import interact, ButtonWidget
from IPython.display import display, clear_output
我没有收到以下错误:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-6-3fa9b991f293> in <module>()
----> 1 from IPython.html.widgets import interact, ButtonWidget
2 from IPython.display import display, clear_output
ModuleNotFoundError: No module named 'widgets'
我尝试将IPython.html.widgets
替换为ipywidgets
并执行它。它让我失望了:
from ipywidgets import interact, ButtonWidget
ImportError: cannot import name ButtonWidget"
答案 0 :(得分:1)
这些对象已经移动了一些重命名:
from ipywidgets import interact, Button