How to Solve NameError: name 'widgets' is not defined -- ipywidgets

Solution: Import the 'widgets' module

To Solve the error, add the following line to the top of your code.

from ipywidgets import widgets

 

For more information:
Python ipywidgets widgets