Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1.9K
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

0

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

over 4 years ago · Santiago Trujillo Relatório

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 Relatório

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 Relatório

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 Relatório

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 Relatório

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 Relatório

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 Relatório

0

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

about 4 years ago · Paula Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda