close

[Solved] Flask – Import: No module named app

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Flask – Import: No module named app in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Flask – Import: No module named app Error Occurs?

Today I get the following error Flask – Import: No module named app in python.

How To Solve Flask – Import: No module named app Error ?

  1. How To Solve Flask – Import: No module named app Error ?

    To Solve Flask – Import: No module named app Error from app import app is looking in the app folder, so the __init__.py file needs to sit in there.

  2. Flask – Import: No module named app

    To Solve Flask – Import: No module named app Error from app import app is looking in the app folder, so the __init__.py file needs to sit in there.

Solution 1

__init__.py is imported using a directory. if you want to import it as app you should put __init__.py file in directory named app

a better option is just to rename __init__.py to app.py

Solution 2

Your __init__.py file needs to go in the folder named app, not the same directory as the run.py file.

from app import app is looking in the app folder, so the __init__.py file needs to sit in there.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read