Error message:
d:\projects\cfblog2_env\scripts\python.exe: can't open file 'D:\projects\cfblog2_env\Scripts\flask': [Errno 2] No such file or directory
Environment: Win 10, Py 3.5.2(VirtualEnv)锛孎lask 0.11
This error was came from '_reload.py' in werkzeug.It seems like when run with flask.exe, sys.executable still equal to python's exe path and sys.argv is something like this:'D:\\projects\\cfblog2_env\\Scripts\\flask', 'run'
I am not sure what cause this problem actually(werkzeug,packer of flask.exe or flask itself).But this error happend when I using flask. So I put the issuse here.
To whom has the same error, you can usepython -m flask run for workaround.
And last, sorry for my poor english.
did you set FLASK_APP=.py?
It seems it can't find flask; which leads me to believe you either have not installed flask or you haven't activated your virtual environment.
To activate your virtual environment:
$ virtualenv env
$ source env/bin/activate
To install flask:
$ pip install flask
Hardly a bug.
Edit: misread, disregard my answer. It indeed looks like a bug figuring out flask's path.
@future0906 does it work when not using debug mode?
@untitaker
Yes, both ways(python -m flask run or flask run) work when not using FLASK_DEBUG=1.
@wgwz @saalaa
Sure I did.And as I said before, this didn't work only when I use flask run and set the debug flag 1.
@future0906 Create a copy of flask.exe and rename it "flask" without the extension. This is a temporary fix.
@untitaker Is this issue similar to #1829?
Yes, appears to be a dupe
Error message:
d:\projects\cfblog2_env\scripts\python.exe: can't open file 'D:\projects\cfblog2_env\Scripts\flask': [Errno 2] No such file or directoryEnvironment: Win 10, Py 3.5.2(VirtualEnv)锛孎lask 0.11
This error was came from '_reload.py' in werkzeug.It seems like when run with flask.exe, sys.executable still equal to python's exe path and sys.argv is something like this:'D:\\projects\\cfblog2_env\\Scripts\\flask', 'run'I am not sure what cause this problem actually(werkzeug,packer of flask.exe or flask itself).But this error happend when I using flask. So I put the issuse here.
To whom has the same error, you can use
python -m flask runfor workaround.
And last, sorry for my poor english.
THANK YOU!!!! I've been trying to get this to work for almost a week, no one could help. Also, your English is great!
Most helpful comment
@untitaker
Yes, both ways(
python -m flask runorflask run) work when not using FLASK_DEBUG=1.@wgwz @saalaa
Sure I did.And as I said before, this didn't work only when I use
flask runand set the debug flag 1.