#8555 :Traceback (most recent call last): File

171.213**1 Posted at: 2 hours ago

:Traceback (most recent call last):
File "videotrans\translator\_base.py", line 82, in run
File "videotrans\translator\_base.py", line 165, in _run_srt
File "tenacity\__init__.py", line 338, in wrapped_f
File "tenacity\__init__.py", line 477, in call
File "tenacity\__init__.py", line 378, in iter
File "tenacity\__init__.py", line 421, in exc_check
tenacity.RetryError: RetryError[]

During handling of the above exception, another exception occurred:

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\_openaicompat.py", line 90, in _item_task
File "videotrans\translator\_openaicompat.py", line 39, in _create_completion
File "openai\_client.py", line 194, in init
openai.OpenAIError: Missing credentials. Please pass an api_key, workload_identity, admin_api_key, or set the OPENAI_API_KEY or OPENAI_ADMIN_KEY environment variable.


=
system:Windows-10-10.0.26300-SP0
version:v4.16
frozen:True
language:zh_CN
root_dir:C:/Users/83178/Desktop/win-pyvideotrans-v4.16

1 Replies

#1 DeepSeek reply at 2 hours ago

核心原因:所用的是 OpenAI 兼容/AI 翻译渠道,但该渠道的 API Key(以及 API 地址)没有填写或未被读取,导致 OpenAI 客户端初始化时抛出 Missing credentials。

按以下步骤处理:

  1. 打开 菜单 → 翻译设置,找到你当前选中的 AI 渠道(OpenAI ChatGPT / 兼容AI / 本地大模型 等)的设置窗口。
  2. 在该窗口内填写 API Key(SK密钥);若使用中转或自建服务,同时填写完整的 API 地址,格式通常为 https://你的域名/v1 或 https://你的域名/v1/chat/completions,不要填 0.0.0.0,本地服务须写 127.0.0.1。
  3. 点击保存/确定,关闭窗口后重新执行任务(建议主界面勾选 清理已生成 后重试)。
  4. 注意:v4.16 起 params.json 中参数名称已规范化,从旧版覆盖升级的,之前填写的 SK 可能已失效,需要回到设置窗口重新填写保存一次。
  5. 若暂无该渠道密钥,可先在主界面把 翻译渠道 换为 DeepSeek(需在其设置里填密钥)或 Google(免费)/Microsoft(免费) 完成翻译。

若填写保存后仍报同样的错,请提供 logs/ 目录下最新日志底部约 30 行内容,以及该渠道设置窗口中的配置截图(隐去密钥)。

请查阅相关文档:

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