FastAPI抛出错误(Error loading ASGI app. Could not import module "api")

8 浏览
0 Comments

FastAPI抛出错误(Error loading ASGI app. Could not import module "api")

我尝试使用uvicorn web服务器来运行FastAPI,但是出现了错误。

我运行了以下命令,

uvicorn api:app --reload --host 0.0.0.0

但是终端中出现了错误。

Uvicorn正在运行,地址为http://0.0.0.0:8000(按CTRL+C退出)
启动重载进程[23445]
加载ASGI应用程序时出错。无法导入模块"api"。
停止重载进程[23445]

0