请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

flask-sqlacodegen报错 win10

E:\reborn\ppt\blueprint>flask-sqlacodegen ‘mysql://root:yshcm123@127.0.0.1/mysql’ --tables user --outfile “common/models/user.py” --flask
Traceback (most recent call last):
File “c:\users\ysh\appdata\local\programs\python\python37\lib\runpy.py”, line 193, in run_module_as_main
"main", mod_spec)
File “c:\users\ysh\appdata\local\programs\python\python37\lib\runpy.py”, line 85, in run_code
exec(code, run_globals)
File "C:\Users\ysh\AppData\Local\Programs\Python\Python37\Scripts\flask-sqlacodegen.exe_main
.py", line 9, in
File “c:\users\ysh\appdata\local\programs\python\python37\lib\site-packages\sqlacodegen\main.py”, line 52, in main
engine = create_engine(args.url)
File "c:\users\ysh\appdata\local\programs\python\python37\lib\site-packages\sqlalchemy\engine_init
.py", line 520, in create_engine
return strategy.create(*args, **kwargs)
File “c:\users\ysh\appdata\local\programs\python\python37\lib\site-packages\sqlalchemy\engine\strategies.py”, line 54, in create
u = url.make_url(name_or_url)
File “c:\users\ysh\appdata\local\programs\python\python37\lib\site-packages\sqlalchemy\engine\url.py”, line 229, in make_url
return _parse_rfc1738_args(name_or_url)
File “c:\users\ysh\appdata\local\programs\python\python37\lib\site-packages\sqlalchemy\engine\url.py”, line 291, in _parse_rfc1738_args
"Could not parse rfc1738 URL from string ‘%s’" % name
sqlalchemy.exc.ArgumentError: Could not parse rfc1738 URL from string ‘‘mysql://root:yshcm123@127.0.0.1/mysql’’

正在回答 回答被采纳积分+3

1回答

编程浪子 2021-02-28 13:20:03

你好

改成如下

flask-sqlacodegen ”mysql://root:yshcm123@127.0.0.1/mysql“ --tables user --outfile “common/models/user.py” --flask


0 回复 有任何疑惑可以回复我~
  • 老师您好,我这里报了这个错误ModuleNotFoundError: No module named 'MySQLdb'
    回复 有任何疑惑可以回复我~ 2022-03-12 16:22:43
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信