onuratakan / gpt-computer-assistant

gpt-4o for windows, macos and linux
MIT License
4.75k stars 441 forks source link

aio.py:39: RuntimeWarning: Proactor event loop does not implement add_reader family of methods required. #108

Closed Adamchanadam closed 2 weeks ago

Adamchanadam commented 3 weeks ago

Error message on Windows 11 : C:\Users\adam\anaconda3\envs\gpt_comp_env\Lib\site-packages\curl_cffi\aio.py:39: RuntimeWarning: Proactor event loop does not implement add_reader family of methods required. Registering an additional selector thread for add_reader support. To avoid this warning use: asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())

I found that this is because the asynchronous IO event loop (ProactorEventLoop) on Windows does not support the add_reader and add_writer methods. The solution is to set the WindowsSelectorEventLoopPolicy at the beginning of your program.Can add the following code at the top of aio.py:

import os
import asyncio

if os.name == 'nt':
    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

to avoid issues with unsupported read/write methods in ProactorEventLoop. Additionally, the spelling error in the warning message has been corrected (from "Curlm alread closed!" to "Curlm already closed!").

Mideky-hub commented 3 weeks ago

Hey! I don't think this is related to the helper, try moving your issue to : https://github.com/yifeikong/curl_cffi as this module is part of their library, thanks for the contribution!

onuratakan commented 2 weeks ago

Actualy, it seems just a warning. Just ignore it.