miguelgrinberg / microblog

The microblogging application developed in my Flask Mega-Tutorial series. This version maps to the 2024 Edition of the tutorial.
http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world
MIT License
4.53k stars 1.62k forks source link

ModuleNotFoundError: No module named 'app' #263

Closed HarshitaMav closed 3 years ago

HarshitaMav commented 3 years ago

Getting this error while checking for configuration in the following command: "from microblog import app"

miguelgrinberg commented 3 years ago

Do you have an app sub directory in the directory from where you run the application? Is the current directory in the Python import path?

HarshitaMav commented 3 years ago

Yes it is in python path and also I don't have any other sub directory other than taught in the tutorial

miguelgrinberg commented 3 years ago

Okay, and how did you confirm that your directory is in the import path? I can't really think of any other possibilities, so something must be missing in your set up.

HarshitaMav commented 3 years ago

Can you tell me what might be missing I can try that way

miguelgrinberg commented 3 years ago

Sorry, let me ask the questions. Only then I can maybe guess what's missing. I asked if the current directory was in the Python import path and you said yes. How did you confirm this?

HarshitaMav commented 3 years ago

Thank you sir, problem solved. My microblog.py was in app folder so it was not able to access app from inside app, Silly mistake!!! Thank you once again.