Please help with python flask-sqlalchemy?

I’m having a little problem with flask-sqlalchemy in eclipse IDE. I want to import db from app but i keep getting ModuleNotFoundError… I’ll just paste the result here for you to see.

from app import db
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘app’

so do you have an app folder? what is the name of the folder that db is in?

# file: app.py

# paths
# root/mymodule/db.py
# root/app.py

from mymodule import db

Thank you for your swift response. I’m a total noob to the whole web development. I cant find which folder the app is located.
I have installed flask-sqlalchemy using the pip install flask-sqlalchemy. I cant find the exact path it was installed and if the module is in the folder

@adeoyewole028 It is often helpful to look at how others have structured their Python/Flask projects. There are many ways to do it, including an advanced method using “Flask Blueprints”. You can do a search on how to structure your Flask application. Play around with your project a bit and you will learn more and more. One more thing, watch out for circular imports. Did you get your project working? Do you have a link to the code so we can look at it?

1 Like