New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"errorMessage": "Unable to import module 'lambda_function': cannot import name 'exceptions' from 'cryptography.hazmat.bindings._rust' (unknown location)", #10863
Comments
Are you running the pip install command on a system with the same ABI as lambda? |
I am creating a lambda layer of Cryptography library on my local machine and then uploading that .zip file on the layer for that lambda_function. my lambda function works perfectly in my local machine, but not in AWS lambda . in our lambda function we are importing below libraries |
You need to build lambdas in environments that match the lambda target. You
can't just build on your local PC and upload it.
…On Sat, Apr 20, 2024 at 9:40 PM Jigar Patel ***@***.***> wrote:
I am creating a lambda layer of Cryptography library on my local machine
and then uploading that .zip file on the layer for that lambda_function.
my lambda function works perfectly in my local machine, but not in AWS
lambda .
in our lambda function we are importing below libraries
"
import csv
import mysql.connector
from cryptography.fernet import Fernet
import os
"
—
Reply to this email directly, view it on GitHub
<#10863 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAGBBO5GK4NF3NXSODZLTY6MKHBAVCNFSM6AAAAABGQ4FN2SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRXHAZTONZZHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
All that is necessary for evil to succeed is for good people to do nothing.
|
can I create this layer on freshly created EC2 instance or is there any other option available? |
An EC2 instance running the same version of Amazon Linux as lambda
would work, yes.
…On Sat, Apr 20, 2024 at 9:48 PM Jigar Patel ***@***.***> wrote:
can I create this layer on freshly created EC2 instance or is there any other option available?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
--
All that is necessary for evil to succeed is for good people to do nothing.
|
thank you for your answer. my error got solved now but a new error came out . when my lambda function got triggered. i got below error log from cloudwatch. File "/opt/python/lib/python3.12/site-packages/cryptography/exceptions.py", line 9, in |
This issue has been waiting for a reporter response for 3 days. It will be auto-closed if no activity occurs in the next 5 days. |
This issue has been waiting for a reporter response for 3 days. It will be auto-closed if no activity occurs in the next 5 days. |
This issue has not received a reporter response and has been auto-closed. If the issue is still relevant please leave a comment and we can reopen it. |
i am using one aws lambda function where i need to import ( from cryptography.fernet import Fernet ) cryptography . i have one layer for that lambda function in which cryptography is installed and zipped.
but on running my lambda function it shows error like "errorMessage": "Unable to import module 'lambda_function': cannot import name 'exceptions' from 'cryptography.hazmat.bindings._rust' (unknown location)",
in directory : layer\python\lib\python3.12\site-packages
i used command : pip install cryptography -t .
The text was updated successfully, but these errors were encountered: