相关疑难解决方法(0)

ImportError:无法导入名称TwilioRestClient

我使用Twilio运行了发送文本的示例代码,代码来自:https://www.twilio.com/docs/libraries/python 我的代码是:

from twilio.rest import TwilioRestClient, 

account_sid = "{{ Account 510 from www.twilio.com/console }}"
auth_token = "{{ Auth Token from www.twilio.com/console  }}"
client = TwilioRestClient(account_sid, auth_token) 
message = clientmessages.create(body="You are the best!", 
                                to="your phone number",  
                                from_="your Twilio number") 
print(message.sid) 
Run Code Online (Sandbox Code Playgroud)

我已经安装了twilio,使用pip,为什么会出现这个问题,请帮忙〜我的代码有一份副本:

from twilio.rest import TwilioRestClient;

account_sid = "{{ ACCOUNT_SID }}" # Your Account SID from www.twilio.com/console
auth_token  = "{{ AUTH_TOKEN }}"  # Your Auth Token from www.twilio.com/console

client = TwilioRestClient(account_sid, auth_token)

message = client.messages.create(body="You are the best!",
    to="+phonenumber", …
Run Code Online (Sandbox Code Playgroud)

python twilio

11
推荐指数
2
解决办法
1万
查看次数

标签 统计

python ×1

twilio ×1