close

[Solved] Could not import “D”: FLASK_APP

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Could not import “D”: FLASK_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 Could not import “D”: FLASK_APP Error Occurs?

Today I get the following error Could not import “D”: FLASK_APP in python.

How To Solve Could not import “D”: FLASK_APP Error ?

  1. How To Solve Could not import “D”: FLASK_APP Error ?

    To Solve Could not import “D”: FLASK_APP Error Remove the directory and just use the name of the file and retry.
    You might need to CD to the directory with your file in it also.

  2. Could not import “D”: FLASK_APP

    To Solve Could not import “D”: FLASK_APP Error Remove the directory and just use the name of the file and retry.
    You might need to CD to the directory with your file in it also.

Solution 1

Remove the directory and just use the name of the file and retry.

You might need to CD to the directory with your file in it also.

Solution 2

from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'
app.run()

We can simply use app.run() to solve this kind of problem.

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