若是你更新了 Werkzeug 到最新的 0.15.5 版本,在 Windows 下執行 flask run 會出現相似下面的報錯:python
d:\repos\flask-examples\.venv\scripts\python.exe: Error while finding module specification for
'D:\\repos\\flask-examples\\.venv\\Scripts\\flask' (ModuleNotFoundError: No module named 'D:\\repos\\flask-examples\\')複製代碼
或是:git
C:\Users\greyli\.virtualenvs\flask-examples-qatl1Peb\Scripts\python.exe: Error while finding module specification for
'C:\Users\greyli\\.virtualenvs\\flask-examples-qatl1Peb\\Scripts\\flask' (ModuleNotFoundError: No module named 'C:\Users\greyli\\')複製代碼
觸發這個錯誤同時要知足的條件通常還有:github
FLASK_ENV=development
解決方法:flask
python -m flask run
命令啓動程序