AWS Lambda doesn't recognized built-in python libraries

0

I use lambda functions for web scraping. The lambda function doesn't recognize basic libs like : requests,beautifulsoup, charset_normalizer and even idna. I can't code like that, I feel that I need to import the whole python interpreter in order to success to run the program please helpEnter image description here

asked a year ago346 views
1 Answer
1
Accepted Answer

The Lambda Python runtime includes only the interpreter itself + the AWS SDK. If you need any library that you need to include in teh requirements.txt, you need to include it in the deployment package. The easiest way to do that is to use SAM. Use sam init to create the project, and later use sam build and sam deploy to deploy the application with all the dependencies.

profile pictureAWS
EXPERT
Uri
answered a year ago
profile picture
EXPERT
reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions