SecurityInnovation / PGPy

Pretty Good Privacy for Python
BSD 3-Clause "New" or "Revised" License
316 stars 98 forks source link

cannot import name 'x509' from 'cryptography.hazmat.bindings._rust' (unknown location) #400

Open saranyasureshkanna opened 2 years ago

saranyasureshkanna commented 2 years ago

I created a python project and used pgpy for encryption. It was tested fine in windows but whenever its uploaded to AWS Lambda it errors out saying "cannot import name 'x509' from 'cryptography.hazmat.bindings._rust' (unknown location)". When I remove PGPY dependencies then the code works without error. So I think the compatibility issue with windows and AWS lambda for PGPY plugin.

CheriseCodes commented 8 months ago

Possibly caused by using an older version of Python that doesn't support Rust bindings to create the lambda layer

Aelger commented 3 months ago

I have the same error and I'm running my Lambda with Python 3.10. Has anyone found a solution?