#5402 name 'ChatterboxTTS' is not definedTraceback (most recent call last): File "/Users/user/Desktop/Source/youtube/lib/pyvi

108.165* Posted at: 17 hours ago

name 'ChatterboxTTS' is not defined
Traceback (most recent call last):
File "/Users/user/Desktop/Source/youtube/lib/pyvideotrans/videotrans/task/only_one.py", line 86, in run

trk.dubbing()

File "/Users/user/Desktop/Source/youtube/lib/pyvideotrans/videotrans/task/trans_create.py", line 667, in dubbing

self._tts()

File "/Users/user/Desktop/Source/youtube/lib/pyvideotrans/videotrans/task/trans_create.py", line 989, in _tts

run_tts(

File "/Users/user/Desktop/Source/youtube/lib/pyvideotrans/videotrans/tts/__init__.py", line 189, in run

return _cls(**kwargs).run()  # type:ignore

File "/Users/user/Desktop/Source/youtube/lib/pyvideotrans/videotrans/tts/_base.py", line 93, in run

self._exec()

File "/Users/user/Desktop/Source/youtube/lib/pyvideotrans/videotrans/tts/_chatterbox.py", line 34, in _exec

model = ChatterboxTTS.from_local(f'{ROOT_DIR}/models/chatterbox',

NameError: name 'ChatterboxTTS' is not defined

cfg=[TaskCfgVTT]当前工作模式: 翻译视频或音频 单视频模式
原始输入文件名: /Users/user/Desktop/abc.mp4,
输出结果保存到文件夹: /Users/user/Desktop/abc-mp4,
临时文件夹: /Users/user/Desktop/Source/youtube/lib/pyvideotrans/tmp/76919/dda06cd2f5
已选 清理已存在
未选 启用CUDA加速
未选 降噪
ASR Channel:faster-whisper(LocalBuilt-in), model_name: large-v3-turbo, 发音语言: English, 断句方式:默认断句
Trans Channel:OpenAI ChatGPT,原始语言:English,目标语言:Vietnamese, 已选 Send SRT
Dubb Channel:ChatterBox(LocalBuilt-in), 角色:clone, 配音语言:Vietnamese, 未选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 未选 视频慢速
字幕: No Subs
已选 分离人声与背景声, 已选 重新嵌入背景声, 背景音量0.8, 背景声音时长 短于 视频时长时: 拉长(降速播放),存在分离后的纯净人声文件,存在分离后的背景声音文件
代理地址:


=
system:macOS-15.7.3-arm64-arm-64bit
version:v4.03
frozen:False
language:en
root_dir:/Users/user/Desktop/Source/youtube/lib/pyvideotrans
Python: 3.10.19 (main, Feb 12 2026, 00:36:33) [Clang 21.1.4 ]

1 Replies

你的错误是由于缺少 chatterbox-tts 依赖导致的。ChatterBox-TTS 是一个需要额外安装的可选本地渠道,未安装时引用 ChatterboxTTS 会引发 NameError

解决方案:

  1. 在 pyvideotrans 项目根目录下,运行以下命令安装 ChatterBox 及其依赖:

    uv sync --extra chatterbox
  2. 如果仍未解决,尝试清除缓存并重新安装所有可选依赖:

    uv sync --all-extras
  3. 确保你的系统已安装 FFmpeg(macOS 使用 brew install ffmpeg)。

完成后重启软件,再次执行任务即可。

请查阅相关文档:

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