How to Solve NameError: name 'Javascript' is not defined -- IPython
Solution: Import the 'Javascript' module
To Solve the error, add the following line to the top of your code.
from IPython import Javascript
For more information:
Python IPython Javascript