0

so it's my first time using the gradio in machine learning, just install it and do some basic import (i use the 3.10.6 python)

import gradio as gr

and comes the error like this

OSError: Cannot load native module 'Crypto.Cipher._raw_ecb': Not found '_raw_ecb.cpython-310-darwin.so', Cannot load '_raw_ecb.abi3.so': cannot load library '/Users/gluthfi/opt/miniconda3/envs/ML-TF2/lib/python3.10/site-packages/Crypto/Util/../Cipher/_raw_ecb.abi3.so': dlopen(/Users/gluthfi/opt/miniconda3/envs/ML-TF2/lib/python3.10/site-packages/Crypto/Util/../Cipher/_raw_ecb.abi3.so, 0x0002): tried: '/Users/gluthfi/opt/miniconda3/envs/ML-TF2/lib/python3.10/site-packages/Crypto/Util/../Cipher/_raw_ecb.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/gluthfi/opt/miniconda3/envs/ML-TF2/lib/python3.10/site-packages/Crypto/Util/../Cipher/_raw_ecb.abi3.so' (no such file), '/Users/gluthfi/opt/miniconda3/envs/ML-TF2/lib/python3.10/site-packages/Crypto/Util/../Cipher/_raw_ecb.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/Users/gluthfi/opt/miniconda3/envs/ML-TF2/lib/python3.10/site-packages/Crypto/Cipher/_raw_ecb.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/gluthfi/opt/miniconda3/envs/ML-TF2/lib/python3.10/site-packages/Crypto/Cipher/_raw_ecb.abi3.so' (no such file), '/Users/gluthfi/opt/miniconda3/envs/ML-TF2/lib/python3.10/site-packages/Crypto/Cipher/_raw_ecb.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')).  Additionally, ctypes.util.find_library() did not manage to locate a library called '/Users/gluthfi/opt/miniconda3/envs/ML-TF2/lib/python3.10/site-packages/Crypto/Util/../Cipher/_raw_ecb.abi3.so', Not found '_raw_ecb.so'

Error Message

i tried to replicate simple ML project from this website, which is pretty simple ML program. i am confused since i got this kind of error only when i just import the gradio. i already tried to make another venv and redo the install and still no go. and i don't use any crypto library, but why it shows me error like this. also i already tried to find any solution out there but found nothing. others got this error because they use the crypto module, also tried to import the crypto module and gave me the same result. Please help, thanks

Binz
  • 35
  • 3
  • 9
  • It seems that you miss an encryption package, but the content you provide is not enough to reflect this problem, because this part of the code can [run correctly](https://i.stack.imgur.com/3fw4x.png) (I just used pip to install these two packages). Can [this issue](https://stackoverflow.com/questions/69619262/cannot-load-native-module-crypto-cipher-raw-ecb-when-using-pyinstaller) help? – MingJie-MSFT Oct 28 '22 at 06:01
  • what kind of encryption package do i need to install? my teacher ask me to run that program, everyone else got no problem except me, so i have to run the program using the google colab. me myself also hoping to give more info about the error, but i only run that line to make sure every import is fine, if it's ok then i'll move to the next step and write more code. i already install the pycryptodomex, still nothing change – Binz Oct 28 '22 at 08:09
  • In order to run your case, I only installed two libraries, tensorflow and gradio by using command `pip install tensorflow` and `pip install gradio`. You can try `pip uninstall` and reinstall. – MingJie-MSFT Oct 28 '22 at 09:36
  • See [this](https://github.com/gradio-app/gradio/issues/1940). Try in a freshly installed python environment. – relent95 Oct 28 '22 at 10:20
  • i already tried to use fresh venv but still no go, also i already tried to use the 3.9 version and still not working. i found out that it works with the 3.11 version, but sadly it isnt available in the anaconda. but there's another catch, i tried "pip install tensorflow-macos" and it gave me the version not found error, which i never had with the conda venv – Binz Oct 28 '22 at 10:53
  • also thank you guys, for your responds. appreciate it! – Binz Oct 28 '22 at 10:55

0 Answers0