How to Solve NameError: name 'mplot3d' is not defined -- mpl_toolkits

Solution: Import the 'mplot3d' module

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

from mpl_toolkits import mplot3d

 

For more information:
Python mpl_toolkits mplot3d