ImportError:无法导入名称'InsecureRequestWarning'(PYTHON3 | RPI3 | gTTS)

sr_*_*_ig 7 python pip text-to-speech importerror raspberry-pi

我在我的覆盆子Pi 3上使用gTTS(Google Text to Speech)时遇到了麻烦.我只是这样做了

sudo pip3 install gTTS
Run Code Online (Sandbox Code Playgroud)

安装它.但是当我运行我的代码时,我发现了这个错误:


File "interface.py", line 7, in <module>

from gtts import *

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'
Run Code Online (Sandbox Code Playgroud)

试图解决我做的问题

sudo easy_install --upgrade pip
Run Code Online (Sandbox Code Playgroud)

然后我卸载并再次安装gtts但问题仍然存在.

非常感谢您的帮助 !:(

PS:我已经安装了python-vlc和mutagen来制作gTTS(正如我在windows设备上所做的那样)

hsp*_*her 6

只需更新requests

pip install -U requests
Run Code Online (Sandbox Code Playgroud)