chaquo / chaquopy

Chaquopy: the Python SDK for Android
https://chaquo.com/chaquopy/
MIT License
807 stars 132 forks source link

ERROR: Failed to install cffi~=1.16.0 #1131

Open flatFeather opened 5 months ago

flatFeather commented 5 months ago
> Task :app:generateDebugPythonRequirements
Chaquopy: Installing for arm64-v8a
Looking in indexes: https://pypi.org/simple, https://chaquo.com/pypi-13.1
Collecting cffi~=1.16.0
  Using cached cffi-1.16.0.tar.gz (512 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /home/python-workspace/beeware/argon2benchmark/build/argon2benchmark/android/gradle/app/build/python/env/debug/bin/python /home/python-workspace/beeware/argon2benchmark/build/argon2benchmark/android/gradle/app/build/python/env/debug/lib/python3.10/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpkyobxfjp
       cwd: /tmp/pip-install-7n3p_ruy/cffi
  Complete output (24 lines):
  Traceback (most recent call last):
    File "/home/python-workspace/beeware/argon2benchmark/build/argon2benchmark/android/gradle/app/build/python/env/debug/lib/python3.10/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
      main()
    File "/home/python-workspace/beeware/argon2benchmark/build/argon2benchmark/android/gradle/app/build/python/env/debug/lib/python3.10/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/home/python-workspace/beeware/argon2benchmark/build/argon2benchmark/android/gradle/app/build/python/env/debug/lib/python3.10/site-packages/pip/_vendor/pep517/_in_process.py", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-sy49unt8/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "/tmp/pip-build-env-sy49unt8/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-sy49unt8/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 148, in <module>
    File "<string>", line 77, in ask_supports_thread
    File "/tmp/pip-build-env-sy49unt8/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/config.py", line 223, in try_compile
      self._compile(body, headers, include_dirs, lang)
    File "/tmp/pip-build-env-sy49unt8/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/config.py", line 128, in _compile
      self.compiler.compile([src], include_dirs=include_dirs)
    File "/tmp/pip-build-env-sy49unt8/site/chaquopy_monkey.py", line 72, in compile
      chaquopy_block_native("CCompiler.compile")
    File "/tmp/pip-build-env-sy49unt8/site/chaquopy_monkey.py", line 105, in chaquopy_block_native
      raise DistutilsPlatformError("{}: {}".format(prefix, CHAQUOPY_NATIVE_ERROR))
  distutils.errors.DistutilsPlatformError: CCompiler.compile: Chaquopy cannot compile native code
  ----------------------------------------
ERROR: Failed to install cffi~=1.16.0 from https://files.pythonhosted.org/packages/68/ce/95b0bae7968c65473e1298efb042e10cafc7bafc14d9e4f154008241c91d/cffi-1.16.0.tar.gz#sha256=bcb3ef43e58665bbda2fb198698fcae6776483e0c4a631aa5647806c25e02cc0 (from -r requirements.txt (line 1)).
mhsmith commented 5 months ago

As you can see from the repository, we currently provide cffi version 1.13.2 for Python 3.8, cffi 1.15.1 for Python 3.9-3.11, and cffi 1.16.0 for Python 3.12.

If you need another combination, you can build it by following the instructions here.

flatFeather commented 5 months ago

could you please tell me which are the versions of cffi, argon2-cffi and argon2-cffi-bindings for python3.11? I have tried with these that I have found in the repository:

"cffi~=1.15.1",
"argon2-cffi~=20.1.0",
"argon2-cffi-bindings~=21.2.0",

But I'm still facing problems:

briefcase build android

[argon2benchmark] Updating app metadata...
Setting main module... done

[argon2benchmark] Building Android APK...

> Configure project :app
Warning: Python version 3.11 may have fewer packages available. If you experience problems, try switching to version 3.8.

> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
> Task :app:extractDebugPythonBuildPackages

> Task :app:generateDebugPythonRequirements
Chaquopy: Installing for arm64-v8a
Looking in indexes: https://pypi.org/simple, https://chaquo.com/pypi-13.1
Collecting cffi~=1.15.1
  Using cached https://chaquo.com/pypi-13.1/cffi/cffi-1.15.1-0-cp311-cp311-android_21_arm64_v8a.whl (169 kB)
Collecting argon2-cffi~=20.1.0
  Downloading https://chaquo.com/pypi-13.1/argon2-cffi/argon2_cffi-20.1.0-1-cp311-cp311-android_21_arm64_v8a.whl (37 kB)
Collecting argon2-cffi-bindings~=21.2.0
  Using cached argon2-cffi-bindings-21.2.0.tar.gz (1.8 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Collecting toga-android~=0.4.0
  Using cached toga_android-0.4.2-py3-none-any.whl (56 kB)
Collecting pycparser
  Using cached pycparser-2.22-py3-none-any.whl (117 kB)
Collecting chaquopy-libffi>=3.3
  Using cached https://chaquo.com/pypi-13.1/chaquopy-libffi/chaquopy_libffi-3.3-2-py3-none-android_21_arm64_v8a.whl (32 kB)
Collecting six
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting toga-core==0.4.2
  Using cached toga_core-0.4.2-py3-none-any.whl (112 kB)
Collecting travertino>=0.3.0
  Using cached travertino-0.3.0-py3-none-any.whl (16 kB)
Building wheels for collected packages: argon2-cffi-bindings
  Building wheel for argon2-cffi-bindings (PEP 517): started
  Building wheel for argon2-cffi-bindings (PEP 517): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /home/python-workspace/beeware/argon2benchmark/build/argon2benchmark/android/gradle/app/build/python/env/debug/bin/python /home/python-workspace/beeware/argon2benchmark/build/argon2benchmark/android/gradle/app/build/python/env/debug/lib/python3.11/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpkqhwcn8m
       cwd: /tmp/pip-install-ae8klotk/argon2-cffi-bindings
  Complete output (13 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-311
  creating build/lib.linux-x86_64-cpython-311/_argon2_cffi_bindings
  copying src/_argon2_cffi_bindings/_ffi_build.py -> build/lib.linux-x86_64-cpython-311/_argon2_cffi_bindings
  copying src/_argon2_cffi_bindings/__init__.py -> build/lib.linux-x86_64-cpython-311/_argon2_cffi_bindings
  running build_ext
  generating cffi module 'build/temp.linux-x86_64-cpython-311/_ffi.c'
  creating build/temp.linux-x86_64-cpython-311
  building '_ffi' extension
  error: CCompiler.compile: Chaquopy cannot compile native code
  ----------------------------------------
ERROR: Failed to install argon2-cffi-bindings~=21.2.0 from https://files.pythonhosted.org/packages/b9/e9/184b8ccce6683b0aa2fbb7ba5683ea4b9c5763f1356347f1312c32e3c66e/argon2-cffi-bindings-21.2.0.tar.gz#sha256=bb89ceffa6c791807d1305ceb77dbfacc5aa499891d2c55661c6459651fc39e3 (from -r requirements.txt (line 3)).
For assistance, please raise an issue at https://github.com/chaquo/chaquopy/issues.
Chaquopy: Exit status 1

> Task :app:generateDebugPythonRequirements FAILED
flatFeather commented 5 months ago

I have also tried with Python 3.8:

cffi: 1.14.3 argon2-cffi-bindings: 20.1.0 argon2-cffi: 20.1.0

But I also get the error CCompiler.compile: Chaquopy cannot compile native code

Can someone help me with this? @mhsmith? is there any way to create the android application with the argon2 library?

mhsmith commented 5 months ago

argon2-cffi version 20 does not require the argon2-cffi-bindings package, so you should remove that from your requirements list.

mhsmith commented 5 months ago

If anyone neads a newer version of cffi, please click the thumbs up button in the top comment, and post a comment explaining why you need it.