我运行的是Python 3.7.2,使用的是twilio版本6.5.0。
我正在尝试使用Python执行Twilio流。我使用的是直接从Twilio's docs复制的以下示例代码
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
# DANGER! This is insecure. See http://twil.io/secure
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
execution = client.studio \
.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
.executions \
.create(parameters={
'foo': 'bar'
}, to='+15558675310', from_='+15017122661')
print(execution.sid)我得到以下错误:Instance of 'Client' has no 'studio' member
显然,我已经相应地更改了Flow ID、to和from_的值。
发布于 2019-07-10 02:14:28
所以我找到了我的解决方案。
我昨晚最初安装了python-twilio客户端,在此期间,pip install twilio下载了包版本6.5.0。一位同事建议Twilio可能是意外地提前发布了该版本,并且未完成,并建议我卸载包并重新安装,果然,pip现在拉下了twilio版本的6.29.0,然后它就可以工作了。
所以,如果其他人遇到这个问题,这就是你的答案。
https://stackoverflow.com/questions/56956974
复制相似问题