简体   繁体   English

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

[英]How to use gTTS in python3 on a Raspberry Pi?

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

$ sudo pip3 install gTTS

After starting python3 I tried to use gTTS as described on their GitHub repo : 启动python3我尝试按照其GitHub存储库中的说明使用gTTS:

>>> from gtts import gTTS

The output is the following: 输出如下:

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'

What can I do to make from gtts import gTTS work? from gtts import gTTS可以做什么?

pip install requests --upgrade对我pip install requests --upgrade

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM