Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
2.2 kB
1
Indexable
Never
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Input In [11], in <cell line: 12>()
     10 import uvicorn
     12 if __name__ == "__main__":
---> 13     uvicorn.run(app)

File /Analytics/venv/CAPEANALYTICS/lib/python3.8/site-packages/uvicorn/main.py:587, in run(app, host, port, uds, fd, loop, http, ws, ws_max_size, ws_max_queue, ws_ping_interval, ws_ping_timeout, ws_per_message_deflate, lifespan, interface, reload, reload_dirs, reload_includes, reload_excludes, reload_delay, workers, env_file, log_config, log_level, access_log, proxy_headers, server_header, date_header, forwarded_allow_ips, root_path, limit_concurrency, backlog, limit_max_requests, timeout_keep_alive, timeout_graceful_shutdown, ssl_keyfile, ssl_certfile, ssl_keyfile_password, ssl_version, ssl_cert_reqs, ssl_ca_certs, ssl_ciphers, headers, use_colors, app_dir, factory, h11_max_incomplete_event_size)
    585     Multiprocess(config, target=server.run, sockets=[sock]).run()
    586 else:
--> 587     server.run()
    588 if config.uds and os.path.exists(config.uds):
    589     os.remove(config.uds)  # pragma: py-win32

File /Analytics/venv/CAPEANALYTICS/lib/python3.8/site-packages/uvicorn/server.py:61, in Server.run(self, sockets)
     59 def run(self, sockets: Optional[List[socket.socket]] = None) -> None:
     60     self.config.setup_event_loop()
---> 61     return asyncio.run(self.serve(sockets=sockets))

File /Analytics/python3/lib/python3.8/asyncio/runners.py:33, in run(main, debug)
      9 """Execute the coroutine and return the result.
     10 
     11 This function runs the passed coroutine, taking care of
   (...)
     30     asyncio.run(main())
     31 """
     32 if events._get_running_loop() is not None:
---> 33     raise RuntimeError(
     34         "asyncio.run() cannot be called from a running event loop")
     36 if not coroutines.iscoroutine(main):
     37     raise ValueError("a coroutine was expected, got {!r}".format(main))

RuntimeError: asyncio.run() cannot be called from a running event loop