Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: module 'alembic.context' has no attribute 'config'

I have imported context from alembic. But the variables like config and configure are unavailable in the package. What could be the reason ?

enter image description here

like image 322
Sivakami Subbu Avatar asked Jul 06 '18 05:07

Sivakami Subbu


1 Answers

alembic.context is only available for the env.py script when it is executed through the alembic command, and provided that the alembic command is executed from a folder containing an alembic.ini file specifying the Alembic configuration to use.

Otherwise, the alembic module does not have a context property.

For more information, see this answer to a similar question.

like image 64
Gallaecio Avatar answered Oct 05 '22 02:10

Gallaecio