#5430 videotrans.configure.excepts.DubbingSrtError: TorchCodec is required for load_with_torchcodec. Please install torchcodec

124.162* Posted at: 8 hours ago

TorchCodec is required for load_with_torchcodec. Please install torchcodec to use this function.:
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 16, in run
File "videotrans\tts\__init__.py", line 192, in run
File "videotrans\tts\_base.py", line 133, in run
videotrans.configure.excepts.DubbingSrtError: TorchCodec is required for load_with_torchcodec. Please install torchcodec to use this function.


=
system:Windows-10-10.0.19045-SP0
version:v4.03
frozen:True
language:zh
root_dir:E:/win-pyvideotrans-v4.03-0622

1 Replies

这是由于预打包版中缺少 torchcodec 库所致。该问题通常在使用依赖本地音频解码的配音渠道(如某些本地 TTS 模型)时触发。

解决方案:

  1. 更换配音渠道:在主界面配音渠道下拉菜单中,选择 Edge-TTS(免费) 或其他非本地的在线配音渠道,可立即绕过该问题。
  2. 更新软件版本:当前版本为 v4.03,请前往官网下载 最新完整版 v4.03-0622(约 2.6GB),覆盖解压即可。新版本已修正此依赖问题。
  3. 采用源码部署:若有技术能力,可参考 源码部署文档 自行安装,并执行 uv sync 以完整安装所有依赖(包含 torchcodec)。
若切换渠道后仍报错,请提供 logs/ 目录下最新的 .log 文件底部 30 行内容以便进一步排查。

请查阅相关文档:

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. Dondate: ko-fi.com/jianchang512

Related resource