flask db upgrade sqlite fails with import error
tedghose opened this issue · 2 comments
flask db upgrade
Traceback (most recent call last):
File "/Users/tirghose/Work/src/py/.venv_upann/bin/flask", line 8, in
sys.exit(main())
File "/Users/tirghose/Work/src/py/.venv_upann/lib/python3.9/site-packages/flask/cli.py", line 994, in main
cli.main(args=sys.argv[1:])
File "/Users/tirghose/Work/src/py/.venv_upann/lib/python3.9/site-packages/flask/cli.py", line 600, in main
return super().main(*args, **kwargs)
File "/Users/tirghose/Work/src/py/.venv_upann/lib/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/tirghose/Work/src/py/.venv_upann/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/tirghose/Work/src/py/.venv_upann/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/tirghose/Work/src/py/.venv_upann/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/tirghose/Work/src/py/.venv_upann/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/tirghose/Work/src/py/.venv_upann/lib/python3.9/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/tirghose/Work/src/py/.venv_upann/lib/python3.9/site-packages/flask/cli.py", line 443, in decorator
with __ctx.ensure_object(ScriptInfo).load_app().app_context():
File "/Users/tirghose/Work/src/py/.venv_upann/lib/python3.9/site-packages/flask/cli.py", line 406, in load_app
app = locate_app(self, import_name, name)
File "/Users/tirghose/Work/src/py/.venv_upann/lib/python3.9/site-packages/flask/cli.py", line 278, in locate_app
return find_app_by_string(script_info, module, app_name)
File "/Users/tirghose/Work/src/py/.venv_upann/lib/python3.9/site-packages/flask/cli.py", line 205, in find_app_by_string
app = call_factory(script_info, attr, args, kwargs)
File "/Users/tirghose/Work/src/py/.venv_upann/lib/python3.9/site-packages/flask/cli.py", line 123, in call_factory
return app_factory(*args, **kwargs)
File "/Users/tirghose/Work/src/py/upann_api/upann/app.py", line 14, in create_app
app.config.from_object("upann.config")
File "/Users/tirghose/Work/src/py/.venv_upann/lib/python3.9/site-packages/flask/config.py", line 162, in from_object
obj = import_string(obj)
File "/Users/tirghose/Work/src/py/.venv_upann/lib/python3.9/site-packages/werkzeug/utils.py", line 887, in import_string
raise ImportStringError(import_name, e).with_traceback(
File "/Users/tirghose/Work/src/py/.venv_upann/lib/python3.9/site-packages/werkzeug/utils.py", line 883, in import_string
raise ImportError(e) from None
werkzeug.utils.ImportStringError: import_string() failed for 'upann.config'. Possible reasons are:
- missing init.py in a package;
- package or module path not included in sys.path;
- duplicated package or module name taking precedence in sys.path;
- missing module, class, function or variable;
Debugged import:
- 'upann' found in '/Users/tirghose/Work/src/py/upann_api/upann/init.py'.
- 'upann.config' not found.
Original exception:
ImportError: module 'upann' has no attribute 'config'
created an empty file to config.py to move on