flask.cli.NoAppException: Could not import "app".
Traceback (most recent call last)
File "/Users/myname/.local/share/virtualenvs/helloflask-VOwUqXuy/lib/python3.7/site-packages/flask/cli.py", line 330, in __call__
rv = self._load_unlocked()
File "/Users/myname/.local/share/virtualenvs/helloflask-VOwUqXuy/lib/python3.7/site-packages/flask/cli.py", line 317, in _load_unlocked
self._app = rv = self.loader()
File "/Users/myname/.local/share/virtualenvs/helloflask-VOwUqXuy/lib/python3.7/site-packages/flask/cli.py", line 372, in load_app
app = locate_app(self, import_name, name)
File "/Users/myname/.local/share/virtualenvs/helloflask-VOwUqXuy/lib/python3.7/site-packages/flask/cli.py", line 246, in locate_app
'Could not import "{name}".'.format(name=module_name)
flask.cli.NoAppException: Could not import "app".
The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.
To switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.
You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection:
dump() shows all variables in the frame
dump(obj) dumps all that's known about the object
Brought to you by DON'T PANIC, your friendly Werkzeug powered traceback interpreter.
working directory: /Users/myname/Documents/GitHub/helloflask/demos/http 已重新安装flask( pipenv install flask 和 pipenv update flask) 问题依旧。 之前在第一章的时候的目录里的实例程序都可以跑起来,到了第二章的实例程序就出问题了。
/Users/myname/.local/share/virtualenvs/helloflask-VOwUqXuy/bin/python -m flask run
http://127.0.0.1:5000/
flask.cli.NoAppException
flask.cli.NoAppException: Could not import "app". Traceback (most recent call last)
The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.
To switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.
You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection:
Brought to you by DON'T PANIC, your friendly Werkzeug powered traceback interpreter.