xpublish
xpublish copied to clipboard
asyncio.run() cannot be called from a running event loop
Hi,
I get this error when executing rest.serve()
with
RuntimeError: asyncio.run() cannot be called from a running event loop
sys:1: RuntimeWarning: coroutine 'Server.serve' was never awaited
I have xpublish 0.2.0, xarray 2022.6.0, uvicorn 0.18.3 I don't have asyncio in my conda list, is it expected ?
Actually I need some more explanations on how it works. I already have a code using fastAPI and the uvicorn server installed.
Should I launch uvicorn for rest.serve() to work ? I get this error when server is switched off too (when I run it in spyder in a quite new environment).
Thank you
It works now, but I don't know why :-)
I got that same error when running ds.rest.serve
from notebooks. I resolved it by running all script in one cell and put the magic
%%python3 --bg --proc a --err err --out std
on top. It was only a test so the script i.e. the cell was short.
I actually do not know how to access the output via the variables a
or err
. if you find out, let me know :)