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
I Keep getting OSError error: _raw_ecb.x86_64-linux-gnu.so: cannot open shared object file: #440
Comments
What version of pycryptodome are you using? Try this:
If that doesn't sort out your issues, consider upgrading Ubuntu to 20.04.latest and repeating the above. |
pycryptodomex==3.9.8 |
I too am getting this error on 16.04. I'm installing Salt and pycryptodome from http://repo.saltstack.com/py3/ubuntu/16.04/amd64/3001
EDIT: I've tried installing |
My results running the self-tests are all as expected: My environment:
I highly recommend upgrading to *buntu 20.04 (LTS). |
Thanks for your reply @texadactyl
And the whole driver for this is trying to upgrade to 20.04, but we're following a dependency chain... Ubuntu 20.04 has deprecated Python 2, but our current version of Salt doesn't support Python 3, so we're trying to upgrade Salt to a version that works with Py3, then we can upgrade to 20.04. Performing major version bumps of Salt and Ubuntu at the same time is a much bigger risk than doing one at a time. Ubuntu 16.04 is still supported until early next year, and we plan to be upgraded before it's EOL'ed and out of support. EDIT: Ok, I just spun up a clean 16.04 VM and the tests are passing on it: |
Update: This does actually look like a packaging problem with the package from the SaltStack repo (not sure why the SelfTest still failed after installing using The package installs to
EDIT 2: No, this still isn't working. I think it's a conflict with the Python 3.8 packages we're installing. Still not specifically a pycrytodome issue, so I'll stop updating this but just wanted to note that the above is not a valid workaround by the look of it. |
OK, final update.... After much rabbit hole exploring this was caused by mixed Python versions in my environment. The Salt packages and dependencies (specifically, Specifically, this breaks pycryptodome when it tries to load the Python 3.5 (correct EXTENSION_SUFFIXES)
Python 3.8 (incorrect EXTENSION_SUFFIXES)
So... Check your Python versions! |
@fukawi2 @Legrandin Would it be possible to compile Pycryptodome against the stable ABI (PEP-3149 and PEP-384)? Extensions compiled that way would work for multiple Python versions. |
@fukawi2 Similar things have happened to me in the past. It is sometimes a painful waste of time but diagnosis is difficult with tools that are unable to flag errors at a sufficient level to zero in on the actual problem (a lot of guess-work by developers too - myself included). So, this was a good lesson for me too. |
I'm just a Salt user, and I'm not familiar enough with Python to fully understand that. I'm guessing it could be possible for the Salt team to do that?
Sorry for all the noise posting updates; hopefully it helps others in the future though. I spent many hours trying to figure this out, and the current Google results weren't helpful in my case. |
So you are saying a mix up of python versions might be the cause? |
Thats my output
|
Do you have |
No i dont.How can i fix it? |
You seem to be running under the wrong version then. We don't know enough about your environment to be able to tell you how to fix it. You said you have "many versions" of Python on your machine, so you're going to need to try and sort that out. |
Well, im running under python3.7 |
@John-Oula Install pycryptodome for the Python version you run your flask app with. E.g. |
Turns out it was my own mistake.I was importing from Cryptodome.Cipher import AES instead of Crypto.Cipher |
Python 3.7.3
Pycryptodome
Ubuntu 16.04
Tried running with python 3.5 and got the same error but when i do the self test it runs successfully under python 3.5
[Thu Aug 13 12:04:38.419037 2020] [wsgi:error] [pid 27768] [remote 157.55.39.158:13599] from Cryptodome.Cipher import AES
[Thu Aug 13 12:04:38.419041 2020] [wsgi:error] [pid 27768] [remote 157.55.39.158:13599] File "/usr/local/lib/python3.7/site-packages/Cryptodome/Cipher/init.py", line 27, in
[Thu Aug 13 12:04:38.419047 2020] [wsgi:error] [pid 27768] [remote 157.55.39.158:13599] from Cryptodome.Cipher._mode_ecb import _create_ecb_cipher
[Thu Aug 13 12:04:38.419051 2020] [wsgi:error] [pid 27768] [remote 157.55.39.158:13599] File "/usr/local/lib/python3.7/site-packages/Cryptodome/Cipher/_mode_ecb.py", line 47, in
[Thu Aug 13 12:04:38.419058 2020] [wsgi:error] [pid 27768] [remote 157.55.39.158:13599] """
[Thu Aug 13 12:04:38.419061 2020] [wsgi:error] [pid 27768] [remote 157.55.39.158:13599] File "/usr/local/lib/python3.7/site-packages/Cryptodome/Util/_raw_api.py", line 308, in load_pycryptodome_raw_lib
[Thu Aug 13 12:04:38.419068 2020] [wsgi:error] [pid 27768] [remote 157.55.39.158:13599] raise OSError("Cannot load native module '%s': %s" % (name, ", ".join(attempts)))
[Thu Aug 13 12:04:38.419079 2020] [wsgi:error] [pid 27768] [remote 157.55.39.158:13599] OSError: Cannot load native module 'Cryptodome.Cipher._raw_ecb': Trying '_raw_ecb.x86_64-linux-gnu.so': /usr/local/lib/python3.7/site-packages/Cryptodome/Util/../Cipher/_raw_ecb.x86_64-linux-gnu.so: cannot open shared object file: No such file or directory, Trying '_raw_ecb.so': /usr/local/lib/python3.7/site-packages/Cryptodome/Util/../Cipher/_raw_ecb.so: cannot open shared object file:
The text was updated successfully, but these errors were encountered: