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