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

posta un anno fa368 visualizzazioni
1 Risposta
2
Risposta accettata

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
ESPERTO
Uri
con risposta un anno fa
profile picture
ESPERTO
verificato 14 giorni fa
profile picture
ESPERTO
verificato un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande