2016-11-26 168 views
0
from gtts import gTTS 
    import os 
    tts=gTTS(text="Both are great",lang="en") 
    tts.save("both.mp3") 
    os.system("mpg12 both.mp3") 

我有这个错误,“无法导入名称gTTS”。运行代码时发生gTTS错误

回答

0

尝试使用命令sudo pip install gtts重新安装gtts模块,您之前的安装可能已损坏或缺少一些依赖关系。