我使用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
工作?
答案 0 :(得分:0)
pip install requests --upgrade
为我工作