ETC/오류 해결 - 2023.02.28 asyncio의 RuntimeError: Event loop is closed 오류 해결 방법 - 원인 Python 3.8 이후 부터, 윈도우는 타 운영체제랑 다른 EventLoop를 기본 값으로 활용한다고 한다. 타 OS 기본 : SelectorEventLoop 윈도우 기본 : ProactorEventLoop 해결 방법 아래 코드를 입력해, 윈도우의 EventLoop를 SelectorEventLoop로 변경하면 된다. asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) 주의 사항 윈도우는 I/O Completion Ports를 활용해 비동기 처리 하기 때문에, SelectorEventLoop로 변경 시 아래와 같은 제약이 있다고 한다. 제약이 문제가 될 경우, Trio 라는 별도의 라이브러리를 사용하는 것이 좋다고 한다. Can't support more than 512 sockets Can't use pipe Can't use subprocesses 참고 Asyncio event loop is closed when using asyncio.run() I'm getting started to AsyncIO and AioHTTP, and i'm writing some basic code to get familiar with the syntax. I tried the following code that should perform 3 requests concurrently: import time import stackoverflow.com Asyncio의 문제와 해결법이 잘 설명돼있다. Platform Support — Python 3.10.10 documentation Platform Support The asyncio module is designed to be portable, but some platforms have subtle differences and limitations due to the platforms’ underlying architecture and capabilities. All Platforms Windows Source code: Lib/asyncio/proactor_events.py, docs.python.org 윈도우에서 asyncio를 사용할 때 제약 사항들이 나와있다. 공유하기 게시글 관리 구독하기싶만생각 Contents 당신이 좋아할만한 콘텐츠 Poetry의 does not contain any element 오류 해결하기 2023.05.12 Github Actions에서 git diff로 이전 Commit 확인하기 2023.03.13 Argument 때문에 jupyter notebook에서 NoneType 에러가 발생할 경우 2023.02.14 Github Stats의 Maximum retries exceeded 오류 해결하기 2023.01.16 댓글 0 + 이전 댓글 더보기