#794 ModuleNotFoundError: No module named 'deepgram.clients'

104.28* Posted at: 29 days ago 👁180

Traceback (most recent call last):

File "/Users/tips/voice/pyvideotrans/videotrans/util/ListenVoice.py", line 18, in run

tts.run(

File "/Users/tips/voice/pyvideotrans/videotrans/tts/__init__.py", line 500, in run

from videotrans.tts._f5tts import F5TTS

File "/Users/tips/voice/pyvideotrans/videotrans/tts/_f5tts.py", line 12, in

from videotrans.configure._except import NO_RETRY_EXCEPT,StopRetry

File "/Users/tips/voice/pyvideotrans/videotrans/configure/_except.py", line 5, in

from deepgram.clients.common.v1.errors import DeepgramApiError

ModuleNotFoundError: No module named 'deepgram.clients'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/Users/tips/voice/pyvideotrans/videotrans/util/ListenVoice.py", line 26, in run

from videotrans.configure._except import get_msg_from_except

File "/Users/tips/voice/pyvideotrans/videotrans/configure/_except.py", line 5, in

from deepgram.clients.common.v1.errors import DeepgramApiError

ModuleNotFoundError: No module named 'deepgram.clients'

=====

macOS-15.7-arm64-arm-64bit

version:v3.80

frozen:False

language:zh

6 Replies

本条内容由 DeepSeek 回复
这是一个与 pyVideoTrans 相关的依赖库缺失问题。错误信息显示缺少 deepgram.clients 模块,这通常发生在源码部署时依赖包未正确安装。

问题分析:

从错误堆栈可以看出,当尝试使用 F5TTS 语音合成功能时,系统无法导入 deepgram.clients 模块。虽然 F5TTS 本身不直接依赖 deepgram,但软件的错误处理模块 _except.py 中引用了该模块,导致导入失败。

解决方案:

1. 重新安装依赖包

在 pyVideoTrans 源码目录下,执行以下命令重新安装所有依赖:

   pip install -r requirements.txt

2. 如果上述方法无效,手动安装 deepgram 包

由于错误处理模块引用了 deepgram,需要单独安装:

   pip install deepgram-sdk

3. 检查 Python 环境

确保你使用的是正确的 Python 环境,特别是如果你使用了虚拟环境(venv)或 conda 环境。

4. 作为临时解决方案

如果你暂时不需要使用 deepgram 相关的功能,可以编辑 videotrans/configure/_except.py 文件,注释掉第5行的导入语句:

   # from deepgram.clients.common.v1.errors import DeepgramApiError

然后将后续使用到 DeepgramApiError 的地方也相应注释掉。

建议:

  • 如果你是源码部署,建议按照官方文档的安装说明重新操作一遍
  • 如果问题持续存在,可以考虑下载预编译版本,避免依赖问题
  • 更多安装帮助请参考官方文档:https://pyvideotrans.com

请尝试上述解决方案,如果问题仍未解决,请提供更多日志信息。

试过了,问题没有解决

mac os 并未解决该问题,请作者修复

这不是bug,不存在修复也无法修复,是本地配置环境没有安装 deepgram 模块

激活虚拟环境后,pip3 install deepgram-sdk 安装该模块

按照此教程一步步: https://pyvideotrans.com/mac

Requirement already satisfied: sniffio>=1.1 in ./venv/lib/python3.10/site-packages (from anyio->httpx>=0.21.2->deepgram-sdk) (1.3.1)

根据开发者回复,这不是软件bug,而是您的本地环境缺少 deepgram 模块。虽然您已经尝试安装,但可能是在错误的Python环境中执行的。

请严格按照以下步骤操作:

  1. 激活虚拟环境
    在终端中,进入您的 pyVideoTrans 源码目录,然后激活虚拟环境:

    source venv/bin/activate
  2. 在激活的虚拟环境中安装
    确保命令行提示符显示 (venv) 前缀,然后执行:

    pip3 install deepgram-sdk
  3. 验证安装
    在虚拟环境中运行Python,测试导入是否成功:

    python -c "from deepgram.clients.common.v1.errors import DeepgramApiError; print('导入成功')"
  4. 重启软件
    安装完成后,重新启动 pyVideoTrans。

如果仍然遇到问题,请确认:

  • 您确实在虚拟环境中操作(命令行前应有 (venv) 标识)
  • 虚拟环境的Python版本与运行软件时使用的版本一致
  • 按照官方Mac安装教程完整操作:https://pyvideotrans.com/mac
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