No module named requests on the AWS Python Lambda function

+1 vote

Hi Guys,

I am trying to create one lambda function and also try to read one url inside that lambda function. For that I am using request function, but I am getting this below error.

Unable to import module 'lambda_function': No module named requests

Apr 15, 2020 in AWS by akhtar
• 38,260 points
16,684 views

1 answer to this question.

0 votes

Hi@akhtar,

For a detailed, You can even check out the details of Migrating to AWS with the AWS Training. Alternatively, you'll have to unzip to the request library inside the directory of your zip file.
Edit: It could be some dependency in your library which requires this. To get around this, make sure to install requests within your application zip. To install this, execute this command in the directory root of your app: pip install requests -t ./

According to my knowledge requests is not a standard library in AWS lambda. So to use this library you can Import it from the Botocore libraries.

from botocore.vendored import requests

answered Apr 15, 2020 by MD
• 95,460 points

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer

Using Shapely on AWS Lambda with Python 3

For some reason, the pip install of ...READ MORE

answered Oct 8, 2018 in AWS by Priyaj
• 58,100 points
2,891 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
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, 2020 in AWS by MD
• 95,460 points
2,419 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP