I am trying to run flask for a flaskr tutorial but I am getting an error

387 views Asked by At

I have installed virtualenv globally and activated it in the flaskr folder. I also pip installed flask in the virtual environment and it's in the scripts folder as flask.exe but every time I run:

 set FLASK_APP=flaskr
 set FLASK_DEBUG=1
 flask run

I get this error:

 (ENV) C:\Users\Owner\Desktop\flaskr>flask run
 * Serving Flask app "flaskr"
 * Forcing debug mode on
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 c:\users\owner\desktop\flaskr\env\scripts\python.exe: can't open file    'C:\Users\Owner\Desktop\flaskr\ENV\Scripts\flask': [Errno 2] No such file or directory

What am I doing wrong?

1

There are 1 answers

2
FallAndLearn On BEST ANSWER

Try running it using

python -m flask run

Python looks for a script named flask, but on windows it is called flask.exe. Hence it is not found.

In the error it is also written can't find scripts\flask