How to Solve NameError: name 'ZipFile' is not defined -- zipfile

Solution: Import the 'ZipFile' module

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

from zipfile import ZipFile

 

For more information:
Python zipfile ZipFile