python - 导入错误:无法导入名称 'InsecureRequestWarning' (PYTHON3 | RPI3 | gTTS)

标签 python raspberry-pi pip text-to-speech importerror

我在我的树莓派 3 上使用 gTTS(Google 文本到语音)时遇到问题。我只是做了

sudo pip3 install gTTS

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


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'

尝试解决我所做的问题

sudo easy_install --upgrade pip

然后我卸载并重新安装了gtts,但问题仍然存在。

非常感谢您的帮助! :(

PS:我已经安装了 python-vlc 和 mutagen 来使 gTTS 正常工作(就像我在 Windows 设备上所做的那样)

最佳答案

只需更新requests

pip install -U requests

关于python - 导入错误:无法导入名称 'InsecureRequestWarning' (PYTHON3 | RPI3 | gTTS),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43500250/

相关文章:

android - 如何使用Android应用程序控制树莓派GPIO端口?

android - 在 Raspberry-Pi 上实现 Android

python - Pip 说安装新版本后安装旧版本

python - 在 Windows 上使用 Pip 在全局环境而不是 virtualenv 中安装包

python - 导入错误 : cannot import name ProtocolError

python - 如何使用 plotly.express.bar 去除条形图周围的白线?

python - 列表中元组的流量强度天数

python - 在多处理池中保持 boto3 session 事件

python - 我如何使用 python 轻松地从 historian 中提取数据?

python - Raspberry PI 3、串行端口和奇怪的响应