似乎我已安裝twilio。從我的終端:終端說Twilio安裝; IDLE不會運行它
sudo easy_install twilio
Password: Searching for twilio Best match: twilio 6.3.dev0 Processing twilio-6.3.dev0-py2.7.egg twilio 6.3.dev0 is already the active version in easy-install.pth
Using /Library/Python/2.7/site-packages/twilio-6.3.dev0-py2.7.egg Processing dependencies for twilio Finished processing dependencies for twilio"
然而,當我嘗試安裝測試:
from twilio.rest import TwilioRestClient
account_sid = "{{SK5f7498ffc677d5071f1e8505f622e04d}}" # Your Account SID from www.twilio.com/console
auth_token = "{{4xhl9pCzyd1oO5VRiMvWq9lIaiVgkvKd}}" # Your Auth Token from www.twilio.com/console
client = TwilioRestClient(account_sid, auth_token)
message = client.messages.create(body="My name is Ron Burgandry?",
to="+16509954344", # Replace with your phone number
from_="+16504828319") # Replace with your Twilio number
print(message.sid)
我收到以下錯誤:
traceback (most recent call last): File "/Users/jonathangheller/Documents/send_text.py", line 1, in from twilio.rest import TwilioRestClient ImportError: No module named 'twilio'"
你沒有使用pip安裝的任何特定原因? https://www.twilio.com/docs/libraries/python –
我得到一個命令未找到錯誤,文檔建議在這種情況下使用easy_install – user449914