ImportError:无法从部分初始化的模块导入名称“ twiml”

时间:2020-11-09 23:21:59

标签: python

运行此命令时,我总是收到错误消息,并且完全按照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)

0 个答案:

没有答案