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