Error when using the layer with the PyCryptodome lib

0

I created a Lambda Layer to use the pycryptodome lib, however when calling the function it is returning an error, could you help me how can I correct this error to make the call?

Error Evidence: error_lib_pycrypto

"errorMessage": "Cannot load native module 'Crypto.Cipher._raw_ecb': Not found '_raw_ecb.cpython-311-x86_64-linux-gnu.so', Not found '_raw_ecb.abi3.so', Not found '_raw_ecb.so'", "errorType": "OSError",

bguerra
已提問 6 個月前檢視次數 434 次
3 個答案
1

Hi,

I would just you to have a look at https://github.com/Legrandin/pycryptodome/issues/69 to find a workaround to your issue. This issue is still open.

Best,

Didier

profile pictureAWS
專家
已回答 6 個月前
  • I'll look and try to follow the explanation.

    Thanks.

1

Hello.

It may not work properly due to dependencies of the OS on which the layer was created.
https://docs.aws.amazon.com/lambda/latest/dg/packaging-layers.html

The first step to creating a layer is to bundle all of your layer content into a .zip file archive. Because Lambda functions run on Amazon Linux, your layer content must be able to compile and build in a Linux environment. If you build packages on your local Windows or Mac machine, you’ll get output binaries for that operating system by default. These binaries may not work properly when you upload them to Lambda.

Most runtimes use Amazon Linux2, so try creating a layer on Amazon Linux2 and see if it works.
https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html

profile picture
專家
已回答 6 個月前
profile pictureAWS
專家
已審閱 6 個月前
0

Hello,

I followed the documentation below and it worked.

https://repost.aws/pt/knowledge-center/lambda-python-package-compatible

Thanks to all for your help.

BG

bguerra
已回答 6 個月前

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

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

回答問題指南