如何在Raspberry Pi上的python3中使用gTTS?

时间:2017-06-13 18:54:08

标签: python raspberry-pi pip raspbian

我使用pip安装了gTTS(1.2.0):

$ sudo pip3 install gTTS

启动python3后,我尝试按照GitHub repo中的说明使用gTTS:

>>> from gtts import gTTS

输出如下:

Traceback (most resent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.4/dist-packages/gtts/__init__.py", line 2, in <module>
from .tts import gTTS
File "/usr/local/lib/python3.4/dist-packages/gtts/tts.py", line 4, in <module> from requests.packages.urllib3.exceptions import InsecureRequestWarning
ImportError: cannot import name 'InsecureRequestWarning'

如何让from gtts import gTTS工作?

1 个答案:

答案 0 :(得分:0)

pip install requests --upgrade为我工作