1

I tried to implement the below code in google app engine. Though I have installed twilio(version: 3.6) by pip(version:2.7), I get an error stating that the module twilio is missing? Why is it so? How do I overcome this?

import webapp2
from twilio import twiml
from twilio.rest import TwilioRestClient



class SendSMS(webapp2.RequestHandler):
    def get(self):
        account_sid = "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6bc"
        auth_token = "xxxxx24f327xxxxxxxxxxxxxxxxxxxxx"
        client = TwilioRestClient(account_sid, auth_token)
        rv = client.sms.messages.create(to="91xxxxxxxxx",
                                        from_="+1xxxxxxxxxxx",
                                        body="Hello Monkey!")
        self.response.write(str(rv))

app = webapp2.WSGIApplication([('/send_sms', SendSMS)],
                              debug=True)

Error I'm getting:

 File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 84, in LoadObject

    obj = __import__(path[0])

  File "C:\Users\TOSHIBA pc\Documents\apps\main\main.py", line 2, in <module>

    from twilio import twiml

ImportError: No module named twilio

INFO     2014-07-08 14:40:35,552 module.py:639] default: "GET / HTTP/1.1" 500 -
Wasim Thabraze
  • 780
  • 1
  • 12
  • 29

1 Answers1

1

Running Twillio through Google app engine is little tricky. Details of implementation can be found here: https://twilio-python.readthedocs.org/en/latest/appengine.html

Wasim Thabraze
  • 780
  • 1
  • 12
  • 29