0

我正在尝试使用 gtts 在 python 中将文本转换为语音 我使用的是 3.7.4 版本的 python 但每当我使用 gtts ModuleNotFoundError: No module named ' main .gtts'; ' main ' 不是一个包,或者有时它说 gtts 模块无法导入 from .gtts import gTTS text2speech = gTTS(text = "HEllo guys",lang = 'en') text2speech.save('sample.mp3') // Traceback(最近一次调用最后):文件“C:/Users/DELL/Desktop/text2speech.py​​”,第 1 行,来自 .gtts导入 gTTS ModuleNotFoundError:没有名为“ main .gtts”的模块;' main ' 不是一个包// 请帮我找到解决方案。

4

1 回答 1

0

它的

from gtts import gTTS

代替

from .gtts import gTTS
于 2020-03-14T11:50:27.213 回答