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

Solution: Import the 'cgitb' module

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

import cgitb

 

For more information:
Python cgitb