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

Solution: Import the 'pytz' module

# Add the following line to the top of your code
import pytz

 

For more information:
Python pytz