简体   繁体   中英

twilio error mac : ModuleNotFoundError: No module named 'twilio'

First of all, I installed twilio by using command 'sudo pip2 install twilio'. It worked well. But when I test the sample code in IDLE, it shows the following error:

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

I'm using 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. By using pip2 you explicitly installed twilio in Python 2.x. interpreter. Use pip3 instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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