Flask can't find app file

前端 未结 2 2115
广开言路
广开言路 2020-12-11 03:15

In Step 2 of the official Flask tutorial, Flask cannot find my app file because it\'s looking in ../venv/Scripts/ instead of where I run the command. How can I

相关标签:
2条回答
  • 2020-12-11 03:46

    You can give full path to app.py when you run "python app.py"

    python C:/path/to/file/app.py
    
    0 讨论(0)
  • 2020-12-11 04:01

    There seems to a bug 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).

    0 讨论(0)
提交回复
热议问题