I am trying to follow the flask documentation on my windows machine given at the following link: http://flask.pocoo.org/docs/0.11/quickstart/#debug-mode
Firstly I wrote
I had got the same issue while running the first hello world for flask.
Ideally there should not be any space between so use set FLASK_APP=run.py
Different shell programs have different ways to set the environment variable in it. So that Flask can discover you application correctly.
Unix Bash/Zsh (Linux, Mac, etc.):
$ export FLASK_APP=hello
$ flask run
Windows CMD:
> set FLASK_APP=hello
> flask run
Windows PowerShell:
> $env:FLASK_APP = "hello"
> flask run
You can find more infomation in the Flask docs.
> set FLASK_APP=Your_file_name.py
> set FLASK_ENV=development
> flask run
it must be work for windows user only
I had the same issue on windows and found a solution from the flask documentation: https://flask.palletsprojects.com/en/1.1.x/tutorial/factory/
My file structure: Flask_folder>>app
(NB! app folder contains: __init_.py and routes.py)
> set FLASK_APP=app
> set FLASK_ENV=development
> flask run
I fixed the same problem by closing the command window and restart it.
Did you run your terminal as administrator? I had the same problem, and running cmd/PowerShell as admin fixed it for me.
Edit: I spoke too soon. Running as admin did nothing.
The real answer (to my problem, at least) is a combination of some of the other answers.
set FLASK_APP = myApp.py
, use setx FLASK_APP myApp.py