Checkbox cannot find application file

In Step 2 of the official Flask tutorial, Flask cannot find my application file because it searches in ../venv/Scripts/ instead of where I run the command. How can I show Flask to look in the right place?

 (venv) C:\Users\TomV\Codes\flaskr_tutorial>flask run * Serving Flask app "flaskr" * Forcing debug mode on * Restarting with stat c:\users\tomv\codes\flaskr_tutorial\venv\scripts\python.exe: can't open file 'C:\Users\TomV\Codes\flaskr_tutorial\venv\Scripts\flask': [Errno 2] No such file or directory 
+9
source share
2 answers

There seems to be an error according to this github issue:

https://github.com/pallets/flask/issues/1829

As a workaround, you can do

 >python -m flask run 

You can also use >python -m flask initdb later in the tutorial when initializing the database (step 4).

+10
source

You can specify the full path to app.py when running "python app.py"

 python C:/path/to/file/app.py 
0
source

All Articles