简体   繁体   English

twilio错误mac:ModuleNotFoundError:没有名为“ twilio”的模块

[英]twilio error mac : ModuleNotFoundError: No module named 'twilio'

First of all, I installed twilio by using command 'sudo pip2 install twilio'. 首先,我使用命令“ sudo pip2 install twilio”安装了twilio。 It worked well. 运行良好。 But when I test the sample code in IDLE, it shows the following error: 但是当我在IDLE中测试示例代码时,它显示以下错误:

from twilio.rest import Client
ModuleNotFoundError: No module named 'twilio'

I'm using macOS Sierra. 我正在使用macOS Sierra。 I've tried many other things found on forums. 我已经尝试了在论坛上找到的许多其他东西。 There is nothing left so I come here to ask for help guys. 什么都没有了,所以我来这里寻求帮助。 Anyways thanks in advance. 无论如何,谢谢。

ModuleNotFoundError can only be raised in Python 3.6, so that's what used in IDLE. ModuleNotFoundError只能在Python 3.6中引发,因此在IDLE中使用。 By using pip2 you explicitly installed twilio in Python 2.x. 通过使用pip2您已在Python 2.x中显式安装了twilio。 interpreter. 口译员。 Use pip3 instead. 请改用pip3

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

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