sqlalchemy.exc.MissingGreenlet: greenlet_spawn has not been called #1379
-
Hi,
The configuration looks like this:
Its the default configuration, besides the Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
hi - you are using a driver that only supports asyncio (aiomysql). The env.py you have above is written for a synchronous driver. Use a sync driver in your alembic script, such as mysqlclient or pymysql (see https://docs.sqlalchemy.org/en/20/dialects/mysql.html#module-sqlalchemy.dialects.mysql.mysqldb). alternately, if you want to use an async driver in your alembic script, you would need to rework the env.py script to be compatible with this, see https://alembic.sqlalchemy.org/en/latest/cookbook.html#using-asyncio-with-alembic where you can choose from a pre-established template option or modify your env.py in place. |
Beta Was this translation helpful? Give feedback.
hi -
you are using a driver that only supports asyncio (aiomysql). The env.py you have above is written for a synchronous driver. Use a sync driver in your alembic script, such as mysqlclient or pymysql (see https://docs.sqlalchemy.org/en/20/dialects/mysql.html#module-sqlalchemy.dialects.mysql.mysqldb).
alternately, if you want to use an async driver in your alembic script, you would need to rework the env.py script to be compatible with this, see https://alembic.sqlalchemy.org/en/latest/cookbook.html#using-asyncio-with-alembic where you can choose from a pre-established template option or modify your env.py in place.