SQLAlchemy 1.3.24和postgresql后端出现错误



我在RHEL 8.4上用postgresql 13和python 3.9安装了SQLAlchemy 1.3.24。当我运行代码时,我得到这个错误:

sqlalchemy.exc.InvalidRequestError:目标引擎没有此类事件"engine_connect"(postgresql+psycopg2://postgres:

这是引发异常的语句:

Base.metadata.create_all
(engine_.execution_options(schema_translate_map={None: prjkey}),
)

通过删除.execution_options(schema_translate_map={None:prjkey}(、解决了问题

这并没有给SQLAlchemy 1.4带来问题,但在SQLAchemy 1.3 中失败了

最新更新