在Python上使用Twilio发送短信

时间:2017-08-14 09:15:58

标签: python twilio importerror urllib3

我输入了提供的示例代码,显然已将我自己的信息替换为必要的位置:

from twilio.rest import Client

account_sid = "ACf2a49cff3675efb3344c603ef08748ef"
auth_token = "myauthtoken"
client = Client(account_sid, auth_token)

message = client.messages.create(
    to="+mynumber", 
    from_="+twilionumber", 
    body="Hi its Gitty!")

print(message.sid)

我收到此错误消息:

Traceback (most recent call last):
  File "C:/Python27/Send a Text.py", line 1, in <module>
    from twilio.rest import Client
  File "C:\Python27\lib\site-packages\twilio-6.5.0-
py2.7.egg\twilio\rest\__init__.py", line 13, in <module>
    from twilio.http.http_client import TwilioHttpClient
  File "C:\Python27\lib\site-packages\twilio-6.5.0-
py2.7.egg\twilio\http\http_client.py", line 1, in <module>
    from requests import Request, Session
  File "C:\Python27\lib\site-packages\requests-2.18.3-
py2.7.egg\requests\__init__.py", line 43, in <module>
    import urllib3
ImportError: No module named urllib3

我在其他地方读到了我可能需要重新安装urllib3或升级它,这两个我已经完成,但仍然没有更改我的错误消息。帮助

0 个答案:

没有答案