我现在有一个瓶中的应用程序中,文件的结构看起来是这样的:
C:\Users\kmelton\Python\Flask\BGSCS-API-dev\InterjectApi\server.py
和文件夹,我目前已开放作为一个工作空间VS码是BGSCS-API-dev文件夹。
我启动。json目前看起来像这样:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Flask",
"type": "python",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "server.py",
"FLASK_ENV": "development"
},
"args": [
"run",
"--no-debugger"
],
"jinja": true
}
]
}
并在每一个调试,尝试,我得到一个错误。
* Serving Flask app 'server.py' (lazy loading)
* Environment: development
* Debug mode: on
Usage: python -m flask run [OPTIONS]
Try 'python -m flask run --help' for help.
Error: Could not import 'server'.
我知道这有可能是我需要的东西添加到我的启动。json文件为道路的文件正确的,但事情我已经试过没有为我工作。 感谢