简体   繁体   中英

Cannot import widget from IPython.html.widgets in Spyder

I am using spyder to run my code.

from Ipython.html.widgets import interact, ButtonWidget

I tried to replace Ipython.html.widgets to ipywidgets and execute it. It threw me back:

from ipywidgets import interact, ButtonWidget

ImportError: cannot import name ButtonWidget"

You said

I am using spyder to run my code.

However, IPython Widgets code can't be run in Spyder because its consoles can't display Html content.

So you need to run this code in the Jupyter notebook.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM