AWS Pandas SDK for Lambda is missing packages

0

I'm trying to create a Lambda function which basically imports a .csv file from an S3 bucket, transforms the data little bit and then save another file in S3. I'm using Python 3.11 runtime and installed PandasSDK for Python 3.11 as the layer of my Lambda function.

When I invoke the function, the first error that came was that the 'fsspec' optional package was not installed.

Then I manually created a layer with 'fsspec' package and then a new message came:

"errorMessage": "Unable to import module 'lambda_function': Install s3fs to access S3".

I tried to create a layer for s3fs, but even after that the same error appears.

AWS Pandas SDK was supposed to have all AWS Wrangler functions available to import / export data from S3 buckets. I tried many things so far but I can't find a proper answer and i'm stuck now in my development.

已提問 9 個月前檢視次數 648 次
1 個回答
0
已接受的答案

After better analyzing the code, I was using the "normal" pandas way to try to ingest the data into S3. I changed the code to use the "to_csv" from awsrwrangler package, and it worked!

已回答 9 個月前
profile pictureAWS
專家
已審閱 9 個月前

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

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

回答問題指南