Skip to content
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

Error while loading in cryptography version 35.0.0 #6378

Closed
xncbf opened this issue Oct 5, 2021 · 5 comments
Closed

Error while loading in cryptography version 35.0.0 #6378

xncbf opened this issue Oct 5, 2021 · 5 comments

Comments

@xncbf
Copy link

xncbf commented Oct 5, 2021

from .api_jwk import PyJWK, PyJWKSet
File "/tmp/project/jwt/api_jwk.py", line 3, in 
from .algorithms import get_default_algorithms
File "/tmp/project/jwt/algorithms.py", line 6, in 
from .utils import (
File "/tmp/project/jwt/utils.py", line 6, in 
from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurve
File "/tmp/project/cryptography/hazmat/primitives/asymmetric/ec.py", line 15, in 
from cryptography.hazmat.primitives.asymmetric import (
File "/tmp/project/cryptography/hazmat/primitives/asymmetric/utils.py", line 6, in 
from cryptography.hazmat.bindings._rust import asn1
ImportError: /tmp/project/cryptography/hazmat/bindings/_rust.abi3.so: invalid ELF header

It works fine in version 3.4.7

@reaperhulk
Copy link
Member

Please provide instructions to reproduce this error.

@alex
Copy link
Member

alex commented Oct 7, 2021

Two days with no response.

@alex alex closed this as completed Oct 7, 2021
@reaperhulk
Copy link
Member

For future issue finders this is almost always because you have installed the wrong binary wheel on the platform you're attempting to run. You'll commonly run into this issue if you do things like try to bundle your local installation of cryptography on a mac and run it on Lambda, etc. We can't provide generic support for this sort of thing, but always install from wheels that you've confirmed work on your target platform.

@tiran
Copy link
Contributor

tiran commented Oct 8, 2021

I posted a pip command that will generate a correct bundle on #6391. You only have to adjust the Python version (--python flag).

@xncbf
Copy link
Author

xncbf commented Oct 8, 2021

Sorry for the late reply.
As @reaperhulk explained above, this was an issue with the lambda environment, super thanks @tiran for the documentation!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants