How do I add python libraries to an AWS lambda function for Alexa?

0 votes

I was following the tutorial to create an Alexa app using Python:

Python Alexa Tutorial

I was able to successfully follow all the steps and get the app to work. I now want to modify the python code and use external libraries such as import requests
or any other libraries that I install using pip. How would I set up my lambda function to include any pip packages that I install locally on my machine?

Oct 23, 2018 in AWS by datageek
• 2,490 points
6,567 views

1 answer to this question.

0 votes

As it is described in the Amazon official documentation link here It is as simple as just creating a zip of all the folder contents after installing the required packages in your folder where you have your python lambda code.

The very first step in moving from an inline code editor to a zip file upload approach is to change your lambda function handler name under configuration settings to include the python script filename that holds the lambda handler.

Other solutions like python-lambda and lambda-uploader help with simplifying the process of uploading and the most importantly LOCAL TESTING. These will save a lot of time in development.

answered Oct 23, 2018 by Archana
• 4,150 points

Related Questions In AWS

0 votes
1 answer
0 votes
2 answers

How do I define the principal for an AWS policy statement?

Check with AWS Policy Documentations once, rest ...READ MORE

answered Jun 25, 2018 in AWS by Cloud gunner
• 4,650 points

edited Jun 26, 2018 by Cloud gunner 294 views
0 votes
1 answer
0 votes
1 answer

How to setup an alarm when Lambda function fails in AWS?

Hi@akhtar, To create an Alarm for Lambda function, ...READ MORE

answered Apr 2 in AWS by MD
• 65,360 points
269 views
0 votes
1 answer

how to get the list of aws services i am used in aws my account by using the lambda function

Hi@shalk, You can create a session in your ...READ MORE

answered Sep 24 in AWS by MD
• 65,360 points
39 views
+1 vote
2 answers

How do I run python script on aws EC2 instance(ubuntu)?

I believe that you are using the ...READ MORE

answered Apr 17, 2018 in AWS by Cloud gunner
• 4,650 points
6,116 views
0 votes
1 answer

How do I invoke another lambda async and pass context to it?

I tried several times trying to pass ...READ MORE

answered Apr 27, 2018 in AWS by Cloud gunner
• 4,650 points
4,147 views
+4 votes
13 answers

Python AWS Boto3: How do i read files from S3 Bucket?

You can download the file from S3 ...READ MORE

answered Dec 7, 2018 in AWS by Jino
173,346 views
0 votes
1 answer

How do I disable detailed monitoring for instances in an auto scaling group in a CloudFormation template?

The property you want is InstanceMonitoring, not ...READ MORE

answered Aug 31, 2018 in AWS by Archana
• 4,150 points
243 views