#8576 Network connection failed:Traceback (most recent call last): File

2a09**7c Posted at: 1 hour ago

Network connection failed:Traceback (most recent call last):
File "google\genai\_gaos\interactions.py", line 756, in create

return _speakeasy_parse_response(http_res)

File "google\genai\_gaos\interactions.py", line 489, in _speakeasy_parse_response

raise errors.CreateInteractionClientError(

google.genai._gaos.errors.createinteraction.CreateInteractionClientError: User location is not supported for the API use.

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\_runner.py", line 71, in run
File "videotrans\translator\_base.py", line 85, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_gemini.py", line 47, in _item_task
File "google\genai\_gaos\google_genai.py", line 278, in create

response = wrap_sdk_call(

File "google\genai\_gaos\lib\compat_errors.py", line 368, in wrap_sdk_call

return fn(*args, **kwargs)

File "google\genai\_gaos\interactions.py", line 758, in create

response_helpers.raise_parse_error(

File "google\genai\_gaos\utils\response_helpers.py", line 92, in raise_parse_error

raise parse_error from exc

google.genai._gaos.lib.compat_errors.BadRequestError: Error code: 400 - {'error': {'message': 'User location is not supported for the API use.', 'code': 'invalid_request'}}


=
system:Windows-10-10.0.28000-SP0
version:v4.17
frozen:True
language:zh_CN
root_dir:E:/常用软件/py417

1 Replies

#1 DeepSeek reply at 1 hour ago

这是因为 Gemini API 不支持你当前所在的地区(中国大陆 IP 直连,以及香港节点均不被 Gemini 支持),请求被 Google 拒绝了。

解决方案(二选一):

方案一:配置可用的代理

  1. 启动你的科学上网工具,并确保节点为美国、日本、新加坡等 Gemini 支持的地区(⚠️ 香港、台湾节点 Gemini 不支持,必报此错)。
  2. 在软件主界面「同步对齐」那一行的 网络代理 文本框中填写代理地址,格式如 http://127.0.0.1:7890(端口以你代理软件实际端口为准)。
  3. 确保代理工具已开启「允许局域网连接 / 系统代理」,然后点击「开始执行」重试。

方案二:更换翻译渠道(推荐,更省事)

  • 在「翻译渠道」下拉中改选 Microsoft(免费)(无需代理)或 DeepSeek(需在 菜单--翻译设置--DeepSeek 填入 API Key,价格极低、质量更好)。
  • 也可选 Google(免费),但同样需要代理。
提示:即使配置了代理,某些机场/代理的出口 IP 仍会被 Gemini 判定为受限地区,此时只能换节点或改换翻译渠道。

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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.

Dondate via ko-fi.com

Related resource