运行此命令时,我总是收到错误消息,并且完全按照Twilio所说的那样复制并粘贴了代码。我按照他们的步骤运行Homebrew,尝试卸载然后重新安装Twilio,但是我遇到了麻烦。有人有什么想法吗?
import os
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ['account sid']
auth_token = os.environ['auth token']
client = Client(account_sid, auth_token)
message = client.messages \
.create(
body="Join Earth's mightiest heroes. Like Kevin Bacon.",
from_='+1twilio number',
to='+1my number'
)
print(message.sid)