#2521 httpx.ConnectTimeout: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

148.135* Posted at: 1 day ago 👁12

网络连接失败:Traceback (most recent call last):
File "httpx\_transports\default.py", line 101, in map_httpcore_exceptions
File "httpx\_transports\default.py", line 250, in handle_request
File "httpcore\_sync\connection_pool.py", line 216, in handle_request
File "httpcore\_sync\connection_pool.py", line 196, in handle_request
File "httpcore\_sync\http_proxy.py", line 289, in handle_request
File "httpcore\_sync\connection.py", line 99, in handle_request
File "httpcore\_sync\connection.py", line 76, in handle_request
File "httpcore\_sync\connection.py", line 122, in _connect
File "httpcore\_backends\sync.py", line 205, in connect_tcp
File "contextlib.py", line 153, in exit
File "httpcore\_exceptions.py", line 14, in map_exceptions
httpcore.ConnectTimeout: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\__init__.py", line 932, in run
File "videotrans\translator\_base.py", line 81, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_gemini.py", line 111, in _item_task
File "google\genai\models.py", line 5783, in generate_content_stream
File "google\genai\models.py", line 4666, in _generate_content_stream
File "google\genai\_api_client.py", line 774, in request_streamed
File "google\genai\_api_client.py", line 671, in _request
File "httpx\_client.py", line 914, in send
File "httpx\_client.py", line 942, in _send_handling_auth
File "httpx\_client.py", line 979, in _send_handling_redirects
File "httpx\_client.py", line 1014, in _send_single_request
File "httpx\_transports\default.py", line 249, in handle_request
File "contextlib.py", line 153, in exit
File "httpx\_transports\default.py", line 118, in map_httpcore_exceptions
httpx.ConnectTimeout: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。


=
system:Windows-10-10.0.26200-SP0
version:v3.87
frozen:True
language:zh
root_dir:E:/ruanjian/win-pyvideotrans-v3.87

1 Replies

这个错误是网络连接超时,通常是由于无法访问 Google Gemini API 服务器导致的。请按以下步骤排查:

  1. 检查网络代理设置

    • 如果您在中国大陆,使用 Gemini 等服务必须配置代理
    • 在主界面第5行“网络代理”处,填写您的代理地址,格式如 http://127.0.0.1:7890socks5://127.0.0.1:7890
  2. 测试代理连通性

    • 打开浏览器,访问 https://gemini.google.com,确认代理工作正常且可以访问 Google 服务。
  3. 切换翻译渠道

    • 如果代理设置正确但问题依旧,可能是 Gemini 服务暂时不稳定或您的网络对 Google 服务有特殊限制。
    • 建议暂时切换到其他翻译渠道,例如:

      • DeepSeek (需在“翻译设置”中配置 API Key)
      • 微软翻译 (免费,但需代理)
      • 百度/腾讯翻译 (国内直连,需申请免费 Key)
  4. 检查防火墙/杀毒软件

    • 暂时禁用防火墙或杀毒软件,看是否是其阻止了 pyVideoTrans 的网络连接。

如果以上步骤均无效,请提供完整的日志文件(位于软件目录下的 logs/ 文件夹内)以便进一步分析。

请查看更多参考文档:

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Donate: https://ko-fi.com/jianchang512

Trending Questions