Python Pusher in AWS Lambda

0 votes

Using AWS Lambda to send push notifications to Pusher app in Python. When I install Pusher and all its dependencies to a directory and zip up to Lambda I run a simple test and get this error.

No module named ndg.httpsclient.ssl_peer_verification
Here is the code I'm trying to run.

from pusher import Pusher

pusher = Pusher(app_id=u'id', key=u'key', secret=u'secret')
def createPitchZip(context, event):
    pusher.trigger('testchannel', 'testevent', {u'some': u'data'})


Can anyone help me in this case?

May 30, 2018 in AWS by Flying geek
• 3,160 points
188 views

1 answer to this question.

0 votes

Using virtualenv to keep track of dependencies will be a good choice for you.

Steps to implement this: 

 1. virtualenv env
 2. env/bin/pip install <your packages>
 3. cd env/lib/python2.7/site-packages; zip -r mylambda.zip *
 4. also zip your lambda handler 

If you have installed everything properly, then zip file mylambda.zip will contain everything you need.

answered May 30, 2018 by Cloud gunner
• 4,280 points

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,940 points
228 views
0 votes
1 answer

Deploy multiple platforms to Elastic Beanstalk

Solve by using .ebextentions to run pre-install commands in ...READ MORE

answered Nov 28, 2018 in AWS by Archana
• 5,560 points
77 views
+3 votes
3 answers
0 votes
2 answers

Receiving SMS from users and stores in AWS

As far as I know, receiving international ...READ MORE

answered Aug 21, 2018 in AWS by Priyaj
• 56,940 points
90 views