How to Solve NameError: name 'ImageGrab' is not defined

Solution: Import the 'ImageGrab' module

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

import ImageGrab

 

For more information:
Python ImageGrab