How to Solve NameError: name 'DictReader' is not defined -- csv

Solution: Import the 'DictReader' module

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

from csv import DictReader

 

For more information:
Python csv DictReader