How to Solve NameError: name 'declarative_base' is not defined -- sqlalchemy

Solution: Import the 'declarative_base' module

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

from sqlalchemy.ext.declarative import declarative_base

 

For more information:
Python sqlalchemy declarative_base