-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When running on Windows 11, the following error occurs. how to fix it? #157
Comments
my guess is that you would need to use But instead of guessing, giving a minimally reproducible example would be more beneficial. |
I use Windows. I'm using the sample code from the readme: import asyncio
from proxybroker import Broker
async def show(proxies):
while True:
proxy = await proxies.get()
if proxy is None: break
print('Found proxy: %s' % proxy)
proxies = asyncio.Queue()
broker = Broker(proxies)
tasks = asyncio.gather(
broker.find(types=['HTTP',], limit=10),
show(proxies))
loop = asyncio.get_event_loop()
loop.run_until_complete(tasks) I get the following error: PS D:\GitRepo\PythonTest> & d:/GitRepo/PythonTest/.venv/Scripts/python.exe d:/GitRepo/PythonTest/ProxyBroker2.py
Traceback (most recent call last):
File "d:\GitRepo\PythonTest\ProxyBroker2.py", line 11, in <module>
broker = Broker(proxies)
^^^^^^^^^^^^^^^
File "D:\GitRepo\PythonTest\.venv\Lib\site-packages\proxybroker\api.py", line 69, in __init__
self._resolver = Resolver(loop=self._loop)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\GitRepo\PythonTest\.venv\Lib\site-packages\proxybroker\resolver.py", line 48, in __init__
self._resolver = aiodns.DNSResolver(loop=self._loop)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\GitRepo\PythonTest\.venv\Lib\site-packages\aiodns\__init__.py", line 55, in __init__
raise RuntimeError(
RuntimeError: aiodns needs a SelectorEventLoop on Windows. See more: https://github.com/saghul/aiodns/issues/86
PS D:\GitRepo\PythonTest> I studied the link (aio-libs/aiodns#86), but it is not clear how to fix it! I ask for help in fixing the problem! |
Does this problem have a solution? |
yes it is the only workaround for now |
What exactly should be done? In the provided answer, it is not clear exactly what actions are needed! |
Please look at this example |
PS D:\GitRepo\PythonTest> & d:/GitRepo/PythonTest/.venv/Scripts/python.exe d:/GitRepo/PythonTest/ProxyBroker2.py |
What python version are you running? |
3.12 |
oh i forgot, my pull request haven't been merged yet. PR #147 will fix this. |
what specific action should be done? Nothing is clear in this discussion |
add the following code after you import asyncio
|
When running on Windows 11, the following error occurs. how to fix it?
PS D:\GitRepo\PythonTest> & d:/GitRepo/PythonTest/.venv/Scripts/python.exe d:/GitRepo/PythonTest/ProxyBroker2.py
Traceback (most recent call last):
File "d:\GitRepo\PythonTest\ProxyBroker2.py", line 11, in
broker = Broker(proxies)
^^^^^^^^^^^^^^^
File "D:\GitRepo\PythonTest.venv\Lib\site-packages\proxybroker\api.py", line 69, in init
self._resolver = Resolver(loop=self._loop)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\GitRepo\PythonTest.venv\Lib\site-packages\proxybroker\resolver.py", line 48, in init
self._resolver = aiodns.DNSResolver(loop=self.loop)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\GitRepo\PythonTest.venv\Lib\site-packages\aiodns_init.py", line 55, in init
raise RuntimeError(
RuntimeError: aiodns needs a SelectorEventLoop on Windows. See more: aio-libs/aiodns#86
PS D:\GitRepo\PythonTest>
The text was updated successfully, but these errors were encountered: