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