#2897 ModuleNotFoundError: No module named 'gtts'

117.183* Posted at: 1 day ago 👁8

Traceback (most recent call last):
File "C:\Users\Administrator\pyvideotrans\pyvideotrans\videotrans\mainwin\_main_win.py", line 332, in _set_default

from videotrans import tts

File "C:\Users\Administrator\pyvideotrans\pyvideotrans\videotrans\tts\__init__.py", line 20, in

from videotrans.tts._gtts import GTTS

File "C:\Users\Administrator\pyvideotrans\pyvideotrans\videotrans\tts\_gtts.py", line 6, in

from gtts import gTTS

ModuleNotFoundError: No module named 'gtts'


=
system:Windows-10-10.0.19045-SP0
version:v3.95
frozen:False
language:zh
root_dir:C:/Users/Administrator/pyvideotrans/pyvideotrans
Python: 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]

1 Replies

这是由于缺少 gtts Python 依赖包导致的。您使用的是源码版(frozen:False),启动时程序尝试加载 gtts 模块失败。

解决方案:

  1. 确保您已进入项目根目录(C:\Users\Administrator\pyvideotrans\pyvideotrans)。
  2. 使用 uv 包管理器安装缺失的依赖。在命令行中执行以下命令:
    uv sync
    此命令会根据项目配置文件安装所有必需的依赖包,包括 gtts
  3. 安装完成后,重新启动软件(运行 uv run sp.py)。

参考文档:

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.

Related resource