使用flask框架链接数据库出现:AttributeError: ‘Engine‘ object has no attribute ‘execute‘

使用flask框架链接数据库出现:AttributeError: ‘Engine’ object has no attribute ‘execute’

出现这个问题就是flask的 sqlalchemy的版本太高了
可以降低自己的这个版本到对于版本
例如:
在这里插入图片描述
这个用法适合

from sqlalchemy import create_engine

这个版本是sqlalchemy版本的是1.4.3的版本
2.0的版本是不适用的
详细可以参考这个github的 issue的回答
原因就是版本不匹配问题

https://github.com/pandas-dev/pandas/issues/40686

可以到这个看看对于版本的用法

猜你喜欢

转载自blog.csdn.net/Deng872347348/article/details/129898331