0

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"
James Draper
  • 5,110
  • 5
  • 40
  • 59
Maddy
  • 146
  • 1
  • 12

1 Answers1

5

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.

Carlos Cordoba
  • 33,273
  • 10
  • 95
  • 124