Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.9K
Views
Running Flask on Windows doesn't execute flask run command

I needed to setup flask for windows, so i wrote the following codes in cmd

set FLASK_APP=application.py
set FLASK_DEBUG=1
set DATABASE_URL='postgres.......' =>(the credential given by the Heroku account)
flask run

But when i hit enter on the flask run, I get an error that says -

flask is not recognized as an internal or external command, operable program or batch file

Why is this not working? I've been trying to work on it but i'm still having the same error message. What could be the issue?

over 4 years ago · Santiago Trujillo
9 answers
Answer question

0

Just install flask on the current directory if you are working in another directory where the flask is not installed.

Install flask: pip install flask

over 4 years ago · Santiago Trujillo Report

0

install flask: pip install flask in the working directory where application.py file is located.

over 4 years ago · Santiago Trujillo Report

0

I faced the same issue. Perhaps you missed the message you received while installing 'flask'. While running pip install flask I received

WARNING: The script flask.exe is installed in 'C:\Users\ankur.kulshrestha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

Either set the path in your PATH env variable or use the complete path while running flask run.

over 4 years ago · Santiago Trujillo Report

0

I had this same issue and resolved it by running this in CMD, where the path is set to your Python scripts folder:

set PATH=C:\Users\YOUR_USER_NAME\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts

The error is related to the "WARNING" that may be shown when running 'pip install flask'. You can also confirm whether you installed flask successfully by using 'pip show flask'.

over 4 years ago · Santiago Trujillo Report

0

Try using:

python -m flask run 

Also make sure you are in the same directory as application.py

over 4 years ago · Santiago Trujillo Report

0

uninstall flask using the following command

pip uninstall flask

close cmd and open cmd as Administrator now run

pip install flask

check:

flask --version
over 4 years ago · Santiago Trujillo Report

0

If you have Anaconda, use python -m flask run from Anaconda Prompt when you are on the folder of the script app.py.

over 4 years ago · Santiago Trujillo Report

0

Make sure you've saved the application.py and the app variable exists.

then run python -m flask run ,

over 4 years ago · Santiago Trujillo Report

0

Error: Could not import 'application'. how is it saved?

about 4 years ago · Paula Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!