You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Python连接Supabase Realtime服务器时出现错误求助

问题:Socket地址解析错误与Realtime版本安装失败

错误信息

Traceback (most recent call last):
  File "/home/scelester/Desktop/finland-backend/test.py", line 16, in <module>
    s.connect()
  File "/home/scelester/Desktop/finland-backend/realtime/connection.py", line 90, in connect
    loop.run_until_complete(self._connect())
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/scelester/Desktop/finland-backend/realtime/connection.py", line 94, in _connect
    ws_connection = await websockets.connect(self.url)
  File "/home/scelester/.virtualenvs/fin-land_rasp/lib/python3.9/site-packages/websockets/legacy/client.py", line 659, in __await_impl_timeout__
    return await asyncio.wait_for(self.__await_impl__(), self.open_timeout)
  File "/usr/lib/python3.9/asyncio/tasks.py", line 481, in wait_for
    return fut.result()
  File "/home/scelester/.virtualenvs/fin-land_rasp/lib/python3.9/site-packages/websockets/legacy/client.py", line 663, in __await_impl__
    _transport, _protocol = await self._create_connection()
  File "/usr/lib/python3.9/asyncio/base_events.py", line 1017, in create_connection
    infos = await self._ensure_resolved(
  File "/usr/lib/python3.9/asyncio/base_events.py", line 1396, in _ensure_resolved
    return await loop.getaddrinfo(host, port, family=family, type=type,
  File "/usr/lib/python3.9/asyncio/base_events.py", line 856, in getaddrinfo
    return await self.run_in_executor(
  File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.9/socket.py", line 953, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

截图

触发该错误的脚本截图:
脚本截图

系统信息

  • 操作系统:Linux Parrot OS
  • supabase-client版本:0.2.5
  • Python版本:3.9.2
  • realtime版本:0.0.5

补充说明

无法按照文档要求安装realtime 0.1.1a0版本,执行命令pip install realtime==0.1.1a0时返回以下错误:

ERROR: Could not find a version that satisfies the requirement realtime==0.1.1a0 (from versions: 0.0.2, 0.0.3, 0.0.4, 0.0.5)
ERROR: No matching distribution found for realtime==0.1.1a0

内容的提问来源于stack exchange,提问作者Nabin Paudel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.07 11:31:11