How to Solve NameError: name 'tz' is not defined -- dateutil

Solution: Import the 'tz' module

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

from dateutil import tz

 

For more information:
Python dateutil tz