python >=3.7.9
Flask 1.12
Flask-SQLAlchemy 2.4.4
Flask-WTF 0.14.3
flask_migrate 2.5.3
flask_script 2.0.6
flask_restful 0.3.8
requests
redis
pymysql 0.10.1
MDB_URI = 'mysql+pymysql://........
TypeError: Invalid argument(s) 'use_native_unicode' sent to create_engine(), using configuration MySQLDialect_mysqldb/QueuePool/Engine. Please check that the keyword arguments are appropriate for this combination of components.
涉及源码 site-packages/sqlalchemy/engine/strategies.py", line 173, in create
# all kwargs should be consumed
if kwargs: # print(kwargs) == {"use_native_unicode":''}
raise TypeError(
"Invalid argument(s) %s sent to create_engine(), "
"using configuration %s/%s/%s. Please check that the "
"keyword arguments are appropriate for this combination "
"of components."
% (
",".join("'%s'" % k for k in kwargs),
dialect.__class__.__name__,
pool.__class__.__name__,
engineclass.__name__,
)
)
engine = engineclass(pool, dialect, u, **engine_args)
db = SQLAlchemy() flask_sqlalchemy/init.py
# 默认 use_native_unicode=True
def __init__(self, app=None, use_native_unicode=True, session_options=None,
metadata=None, query_class=BaseQuery, model_class=Model,
engine_options=None):
是不是 flask_sqlalchemy 和 sqlalchemy 兼容问题,除了改源码还有别的解决方法吗。
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.