1

每当我安装和导入 gTTS 时,我都会遇到这个问题。安装问题:

ERROR: Could not install packages due to an OSError: [WinError 2] The system cannot find the file specified: 'C:\\Python310\\Scripts\\gtts-cli.exe' -> 'C:\\Python310\\Scripts\\gtts-cli.exe.deleteme'

导入问题:

Traceback (most recent call last):
  File "C:/Users/User/Desktop/check.py", line 1, in <module>
    from gtts import gTTS
ModuleNotFoundError: No module named 'gtts'

我做了pip install gtts 并导入了from gtts import gTTS.

谢谢!

PS:Python版本:3.10.0

4

1 回答 1

0

如何在 Python 中安装 gTTS。

由于管理员访问权限,安装和使用可能会出现问题。解决方案是使用以下命令安装 gTTS: pip install -U gtts


参考:https ://github.com/pypa/pip/issues/9023#issuecomment-713171229

于 2021-12-31T08:51:49.597 回答