Error: Could not locate Flask application. You did not provide the FLASK_APP environment variable.

Problem description:

Error: Could not locate Flask application. You did not provide the FLASK_APP environment variable.

why
The FLASK_APP environment variable is not set
To solve
Under the win10
Powershell: $env:FLASK_APP="main.py" remember to replace main.py with your own filename
Py main. Py CMD: set FLASK_APP=flasky.py
As opposed to PowerShell… 😈

Read More: