-
Notifications
You must be signed in to change notification settings - Fork 509
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
Failing on M1 Mac - OSError: Cannot load native module 'Crypto.Hash._SHA256' #615
Comments
As I do not have an ARM Mac (or any Mac at all), I can only be of little help. The error message indicates the compiled extensions and your Python installation have different architectures. Do you mind telling which architecture your Python and the installed extension has? You should be able to get it with |
I am having a near identical issue (but failing to import _raw_ecb native module). PyCryptoDome was installed as part of other project dependencies (using Poetry over pip), and have the same errors coming back as the OP. Outputs of your suggested commands:
|
Some users of my application are complaining about the same problem. |
I also have this problem with Python 3.8.12, Poetry, on Apple M1 |
same problem here, python 3.10 |
resolved by downgrading to python 3.9, in my case I was using a function that uses a module called pyteal, downgrading forced me to use a different version of petal and now everything works as expected |
This is the traceback from one of them:
|
@xilopaint although they might be related, you are now receiving a different error, which looks like the one Will is receiving, in my case it worked simply downgrading. I used a clean python installation |
Hi, I'm currently running into this issue myself. Is there a clear idea on why the x86 shared object is being installed instead of the arm64 one? Is there a way to force the install to use the arm64 version? It seems that this isn't version specific to Pycryptodome, but python. Things are working somehow when I am on python 3.9 vs python 3.10. @Legrandin your help would be much appreciated here! |
Hi, I have the same error. |
I am also having the same problem.
Does anyone know anything about this? |
I have same issue here. I am trying to make layer for aws sam project. I am using macbook m1. |
I also have the same problem as @Rikuto7 . I have an application which depends on pycryptodome and I try to run it in a docker container.
What I figured out is that when pycryptodome tries to collect the C file extensions suffixes the .cpython-38-x86_64-linux-gnu.so suffix is not showing up. This is the 3.6.1 pycryptodome part which handles the lib loading:
It doesn't matter which branch get executed the .cpython-38-x86_64-linux-gnu.so extension suffix is missing, although when I start the interpreter and run imp.get_suffixes() or machinery.EXTENSION_SUFFIXES the suffixes is there. When I modify the lib and include the suffix in the initial extension_suffixes or append to it the .so get loaded fine I don't know if the two cases (docker, Mac M1) is related but very similar. python version is 3.8.10 |
I am trying to follow the installation guide for PyCryptodome. But when I try to run Cryptodome / Crypto modules in my code it is giving me the following error.
With python3.9, I've tried installing pycryptodome 3.14.1, removing pycryptodome 3.14.1 then install pycryptodomex 3.14.1, removing pycryptodome x3.14.1 then install pycryptodome 3.10.1,
Then I tried to update my python to python3.10 using ARM, and install pycryptodome 3.14.1, which is still giving me the same error.
Should I try reinstalling python? ;( Any help is appreciated. Thanks in advance.
The text was updated successfully, but these errors were encountered: