How to Solve NameError: name 'canvas' is not defined -- reportlab

Solution: Import the 'canvas' module

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

from reportlab.pdfgen import canvas

 

For more information:
Python reportlab canvas