I was try to migrate my database using flask_migrate when i was hitting the flask db init that time
getting below error.
Error: While importing ‘app’, an ImportError was raised:
Traceback (most recent call last):
File “C:UsersAdminDesktopFlask REST APIs.venvlibsite-packagesflaskcli.py”, line 245, in locate_app import(module_name)
File “C:UsersAdminDesktopFlask REST APIsapp.py”, line 6, in
from db import db
File “C:UsersAdminDesktopFlask REST APIsdb.py”, line 1, in
from flask_sqlalchemy import SQLAlchemy
File “C:UsersAdminDesktopFlask REST APIs.venvlibsite-packagesflask_sqlalchemy_init_.py”, line 14, in
from flask import _app_ctx_stack, abort, current_app, request
ImportError: cannot import name ‘app_ctx_stack’ from ‘flask’ (C:UsersAdminDesktopFlask REST APIs.venvlibsite-packagesflask_init.py)
Usage: flask [OPTIONS] COMMAND [ARGS]…
Try ‘flask –help’ for help.
Error: No such command ‘db’.
I have try diffence version on flask to install and uninstall but it will geting same error or
diffence some things on it.
Manav shah is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.