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

gefragt vor einem Jahr372 Aufrufe
1 Antwort
2
Akzeptierte Antwort

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
EXPERTE
Uri
beantwortet vor einem Jahr
profile picture
EXPERTE
überprüft vor 19 Tagen
profile picture
EXPERTE
überprüft vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen