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