While trying to develop a FastAPI client in Spyder environment, one cannot start the execution.
The code fails and raises:
RuntimeError: asyncio.run() cannot be called from a running event loop Minimum code to be executed:
from fastapi import FastAPI
import uvicorn
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}
if __name__ == '__main__':
uvicorn.run(app, port=8080, host='0.0.0.0')