【发布时间】:2021-10-24 10:24:04
【问题描述】:
文件名是 main.py 每当我运行uvicorn main:app --reload
我在代码下得到错误。
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}
错误
INFO: Will watch for changes in these directories: ['/Users/Documents/main.py']
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: Started reloader process [58745] using statreload
ERROR: Error loading ASGI app. Could not import module "main".
【问题讨论】:
标签: python command-line frameworks fastapi