Python 3.9: RuntimeError: Running with asyncio requires installation of 'httpcore[asyncio]' #980
Unanswered
jredblue
asked this question in
Potential Issue
Replies: 1 comment 1 reply
-
That's promising, thanks. Are you able to test against 3.10? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Seeing this failure that was previously seen in #825. Since that issue was supposedly resolved I thought I'd start a new discussion!
Important to note: I found that this error occurs on Python 3.9, after hours of debugging I tried 3.11 and all issues went away! I wasn't aware that 3.9 wasn't supported but if it isn't then I guess this is not an issue after all. I installed all necessary packages including httpcore[asyncio] which the error requests me to do. Here are the package versions to reproduce:
anyio==4.6.2.post1
httpcore==1.0.7
httpx==0.27.2
"exception": "Traceback (most recent call last):\n File <leaving out file name> response = await client.get(url)\n File \"/var/task/httpx/_client.py\", line 1814, in get\n return await self.request(\n File \"/var/task/httpx/_client.py\", line 1585, in request\n return await self.send(request, auth=auth, follow_redirects=follow_redirects)\n File \"/var/task/httpx/_client.py\", line 1674, in send\n response = await self._send_handling_auth(\n File \"/var/task/httpx/_client.py\", line 1702, in _send_handling_auth\n response = await self._send_handling_redirects(\n File \"/var/task/httpx/_client.py\", line 1739, in _send_handling_redirects\n response = await self._send_single_request(request)\n File \"/var/task/httpx/_client.py\", line 1776, in _send_single_request\n response = await transport.handle_async_request(request)\n File \"/var/task/httpx/_transports/default.py\", line 377, in handle_async_request\n resp = await self._pool.handle_async_request(req)\n File \"/var/task/httpcore/_async/connection_pool.py\", line 224, in handle_async_request\n async with self._pool_lock:\n File \"/var/task/httpcore/_synchronization.py\", line 62, in __aenter__\n self.setup()\n File \"/var/task/httpcore/_synchronization.py\", line 55, in setup\n raise RuntimeError(\nRuntimeError: Running with asyncio requires installation of 'httpcore[asyncio]'.\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File <leaving out file name> line 138, in <leaving out function name>\n <leaving out function call>\n File <leaving out file name>, line 66, in <leaving out function name>\n <leaving out function code>\n File \"/var/task/backoff/_async.py\", line 151, in retry\n ret = await target(*args, **kwargs)\n File <leaving out file name>, line 16, in <leaving out function name>\n <leaving out function code>\n File \"/var/task/httpx/_client.py\", line 2062, in __aexit__\n await self._transport.__aexit__(exc_type, exc_value, traceback)\n File \"/var/task/httpx/_transports/default.py\", line 356, in __aexit__\n await self._pool.__aexit__(exc_type, exc_value, traceback)\n File \"/var/task/httpcore/_async/connection_pool.py\", line 327, in __aexit__\n await self.aclose()\n File \"/var/task/httpcore/_async/connection_pool.py\", line 312, in aclose\n async with self._pool_lock:\n File \"/var/task/httpcore/_synchronization.py\", line 67, in __aenter__\n await self._anyio_lock.acquire()\nAttributeError: 'AsyncLock' object has no attribute '_anyio_lock'"
Beta Was this translation helpful? Give feedback.
All reactions