a-shell icon indicating copy to clipboard operation
a-shell copied to clipboard

pip install pycryptodome

Open ghost opened this issue 1 year ago • 11 comments

When I used pip to install pycryptodome, I got stuck.Like this.image

ghost avatar Jul 06 '22 10:07 ghost

Hi, As mentioned in issues #370, #380, #392 and #416, pycryptodome has modules written in C, so it cannot be installed by the user because there are no compilers available. I'll have to add it at the app level.

If your goal is to run yt-dlp, you can make it install without pycryptodome with pip install --no-deps yt-dlp.

holzschu avatar Jul 06 '22 12:07 holzschu

Thank you so mush!

ghost avatar Jul 06 '22 14:07 ghost

@holzschu Is it possible to share a webasm compiled version until you push it to the main release on appstore? I am using a library that relies completely on pycryptodome

adityasanghvi avatar Jul 08 '22 01:07 adityasanghvi

I haven't found a way to make a digital library using WebAssembly. Executables work fine, but not digital libraries.

holzschu avatar Jul 08 '22 06:07 holzschu

Version 1.9.4 (now out on the AppStore) has pycryptodome included.

holzschu avatar Jul 13 '22 20:07 holzschu

I tried with a-Shell Mini version 1.9.4, but I still have trouble with it... 😓

[~/Documents]$ pip3 -v install pycryptodome
Using pip 22.1.2 from /var/mobile/Containers/Data/Application/C48DFEE4-9F81-4F04-B374-068FA81DD0C4/Library/lib/python3.9/site-packages/pip (python 3.9)
Defaulting to user installation because normal site-packages is not writeable
Collecting pycryptodome
  Using cached pycryptodome-3.15.0.tar.gz (4.5 MB)
  Running command python setup.py egg_info
  Testing support for clang
  clang: command not found
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/private/var/mobile/Containers/Data/Application/C48DFEE4-9F81-4F04-B374-068FA81DD0C4/tmp/pip-install-70cxvbhv/pycryptodome_97680b5db1e4429daff1a26bff39ea46/setup
.py", line 488, in <module>
      set_compiler_options(package_root, ext_modules)
    File "/private/var/mobile/Containers/Data/Application/C48DFEE4-9F81-4F04-B374-068FA81DD0C4/tmp/pip-install-70cxvbhv/pycryptodome_97680b5db1e4429daff1a26bff39ea46/compi
ler_opt.py", line 341, in set_compiler_options
      clang = compiler_is_clang()
    File "/private/var/mobile/Containers/Data/Application/C48DFEE4-9F81-4F04-B374-068FA81DD0C4/tmp/pip-install-70cxvbhv/pycryptodome_97680b5db1e4429daff1a26bff39ea46/compi
ler_opt.py", line 251, in compiler_is_clang
      return test_compilation(source, msg="clang")
    File "/private/var/mobile/Containers/Data/Application/C48DFEE4-9F81-4F04-B374-068FA81DD0C4/tmp/pip-install-70cxvbhv/pycryptodome_97680b5db1e4429daff1a26bff39ea46/compi
ler_opt.py", line 101, in test_compilation
      dev_null.close()
  OSError: [Errno 9] Bad file descriptor

It just hangs there forever.

I also tried install pycryptodomex. Same issue:

[~/Documents]$ pip3 -v install pycryptodomex
Using pip 22.1.2 from /var/mobile/Containers/Data/Application/C48DFEE4-9F81-4F04-B374-068FA81DD0C4/Library/lib/python3.9/site-packages/pip (python 3.9)
Defaulting to user installation because normal site-packages is not writeable
Collecting pycryptodomex
  Using cached pycryptodomex-3.15.0.tar.gz (4.5 MB)
  Running command python setup.py egg_info
  Testing support for clang
  clang: command not found
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/private/var/mobile/Containers/Data/Application/C48DFEE4-9F81-4F04-B374-068FA81DD0C4/tmp/pip-install-lw2r5sg3/pycryptodomex_021529e2d6d94f76a5b12e969172a5e2/setu
p.py", line 488, in <module>
      set_compiler_options(package_root, ext_modules)
    File "/private/var/mobile/Containers/Data/Application/C48DFEE4-9F81-4F04-B374-068FA81DD0C4/tmp/pip-install-lw2r5sg3/pycryptodomex_021529e2d6d94f76a5b12e969172a5e2/comp
iler_opt.py", line 341, in set_compiler_options
      clang = compiler_is_clang()
    File "/private/var/mobile/Containers/Data/Application/C48DFEE4-9F81-4F04-B374-068FA81DD0C4/tmp/pip-install-lw2r5sg3/pycryptodomex_021529e2d6d94f76a5b12e969172a5e2/comp
iler_opt.py", line 251, in compiler_is_clang
      return test_compilation(source, msg="clang")
    File "/private/var/mobile/Containers/Data/Application/C48DFEE4-9F81-4F04-B374-068FA81DD0C4/tmp/pip-install-lw2r5sg3/pycryptodomex_021529e2d6d94f76a5b12e969172a5e2/comp
iler_opt.py", line 101, in test_compilation
      dev_null.close()
  OSError: [Errno 9] Bad file descriptor

Emasoft avatar Jul 14 '22 18:07 Emasoft

You don’t need to install pycryptodome, it is already installed. Interestingly, “pip show pycryptodome” does not work, and I’ll have to look at that, but “import Crypto” does work.

holzschu avatar Jul 14 '22 20:07 holzschu

It is not shown in 'pip list', so every package with it as a dependency will try to install it, crashing. Other installed packages, like Pillow or Pigments, return "Requirement already satisfied", and work fine as a dependency. Why doesn't pycryptodome return the same message?

Emasoft avatar Jul 15 '22 09:07 Emasoft

I'm on it. It will be fixed in the next version.

holzschu avatar Jul 17 '22 17:07 holzschu

Hi, version 1.9.5 of a-Shell mini on TestFlight has both pycryptodome and pycryptodomex, and pip knows about them. I hope it works now.

holzschu avatar Jul 21 '22 06:07 holzschu

Great! 👍

Emasoft avatar Jul 21 '22 13:07 Emasoft