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

已提問 1 年前檢視次數 368 次
1 個回答
2
已接受的答案

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
專家
Uri
已回答 1 年前
profile picture
專家
已審閱 14 天前
profile picture
專家
已審閱 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南