chaquo / chaquopy

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

Failed to install homcloud #1179

Open yk0994 opened 2 weeks ago

yk0994 commented 2 weeks ago

Chaquopy version

plugins {
    id("com.android.application") version "8.1.3" apply false
    id("org.jetbrains.kotlin.android") version "1.9.0" apply false
    id("com.chaquo.python") version "15.0.1" apply false
}

Relevant parts of your code


android {
    namespace = "com.example.myapplication"
    compileSdk = 34

    defaultConfig {
        applicationId = "com.example.myapplication"
        minSdk = 24
        targetSdk = 34
        versionCode = 1
        versionName = "1.0"

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
        defaultConfig {
            ndk {
                // On Apple silicon, you can omit x86_64.
                abiFilters += listOf("armeabi-v7a")
            }
        }
    }

    buildTypes {
        release {
            isMinifyEnabled = false
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }
}

chaquopy {
    defaultConfig {
        version = "3.11"
        pip {
            install("homcloud")
        }
    }
}

Describe your issue

> Task :app:generateDebugPythonRequirements
Chaquopy: Installing for armeabi-v7a
Looking in indexes: https://pypi.org/simple, https://chaquo.com/pypi-13.1
Collecting homcloud
  Using cached homcloud-4.4.1.tar.gz (24.0 MB)

> Task :app:generateDebugPythonRequirements
  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 matplotlib
  Downloading https://chaquo.com/pypi-13.1/matplotlib/matplotlib-3.6.0-0-cp311-cp311-android_21_armeabi_v7a.whl (6.9 MB)
Collecting Cython
  Using cached Cython-3.0.10-py2.py3-none-any.whl (1.2 MB)
Collecting pulp
  Using cached PuLP-2.8.0-py3-none-any.whl (17.7 MB)
Collecting scipy
  Downloading scipy-1.13.1.tar.gz (57.2 MB)
  Installing build dependencies: started
  Installing build dependencies: still running...
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\xxx\work_android\MyApplication18\app\build\python\env\debug\Scripts\python.exe' 'C:\Users\xxx\work_android\MyApplication18\app\build\python\env\debug\Lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\xxx\AppData\Local\Temp\tmp0cm4x_z8'
         cwd: C:\Users\xxx\AppData\Local\Temp\pip-install-oimxff69\scipy
    Complete output (46 lines):
    Traceback (most recent call last):
      File "C:\Users\xxx\work_android\MyApplication18\app\build\python\env\debug\Lib\site-packages\pip\_vendor\pep517\_in_process.py", line 126, in prepare_metadata_for_build_wheel
        hook = backend.prepare_metadata_for_build_wheel
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: module 'mesonpy' has no attribute 'prepare_metadata_for_build_wheel'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "C:\Users\xxx\work_android\MyApplication18\app\build\python\env\debug\Lib\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in <module>
        main()
      File "C:\Users\xxx\work_android\MyApplication18\app\build\python\env\debug\Lib\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\xxx\work_android\MyApplication18\app\build\python\env\debug\Lib\site-packages\pip\_vendor\pep517\_in_process.py", line 130, in prepare_metadata_for_build_wheel
        return _get_wheel_metadata_from_wheel(backend, metadata_directory,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\xxx\work_android\MyApplication18\app\build\python\env\debug\Lib\site-packages\pip\_vendor\pep517\_in_process.py", line 159, in _get_wheel_metadata_from_wheel
        whl_basename = backend.build_wheel(metadata_directory, config_settings)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-dzw77sk8\overlay\Lib\site-packages\mesonpy\__init__.py", line 1020, in wrapper
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-dzw77sk8\overlay\Lib\site-packages\mesonpy\__init__.py", line 1073, in build_wheel
        with _project(config_settings) as project:
      File "C:\Users\xxx\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 137, in __enter__
        return next(self.gen)
               ^^^^^^^^^^^^^^
      File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-dzw77sk8\overlay\Lib\site-packages\mesonpy\__init__.py", line 947, in _project
        yield Project(source_dir, build_dir, meson_args, editable_verbose)
    ERROR: Command errored out with exit status 1:

              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-dzw77sk8\overlay\Lib\site-packages\mesonpy\__init__.py", line 662, in __init__
        self._meson = _get_meson_command(pyproject_config.get('meson'))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\xxx\AppData\Local\Temp\pip-build-env-dzw77sk8\overlay\Lib\site-packages\mesonpy\__init__.py", line 982, in _get_meson_command
        meson_version = subprocess.run(cmd + ['--version'], check=False, text=True, capture_output=True).stdout
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\xxx\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 548, in run
        with Popen(*popenargs, **kwargs) as process:
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\xxx\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1026, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "C:\Users\xxx\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1538, in _execute_child
        hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    FileNotFoundError: [WinError 2] ?w?????t?@?C???????????????B
    ----------------------------------------
ERROR: Failed to install scipy from https://files.pythonhosted.org/packages/ae/00/48c2f661e2816ccf2ecd77982f6605b2950afe60f60a52b4cbbc2504aa8f/scipy-1.13.1.tar.gz#sha256=095a87a0312b08dfd6a6155cbbd310a8c51800fc931b8c0b84003014b874ed3c (from homcloud).
For assistance, please raise an issue at https://github.com/chaquo/chaquopy/issues.
Failed to install scipy from https://files.pythonhosted.org/packages/ae/00/48c2f661e2816ccf2ecd77982f6605b2950afe60f60a52b4cbbc2504aa8f/scipy-1.13.1.tar.gz#sha256=095a87a0312b08dfd6a6155cbbd310a8c51800fc931b8c0b84003014b874ed3c (from homcloud).

Chaquopy: Exit status 1
mhsmith commented 2 weeks ago

This package contains native components, so it would have to be built into an Android wheel file. If you'd like to try doing this yourself, follow the instructions here. And if you're successful, please make a pull request so we can add the package to the public repository.

From the error message, it looks like this package uses the Meson build system, which the build tool isn't compatible with yet. If there's an older version that uses Setuptools instead, you should probably try building that first.

If anyone else wants this package too, let us know by clicking the thumbs-up button above.

mohdahmad242 commented 2 days ago

@mhsmith Can you please explain this in the Chaquopy packages Readme

Use pip to install the requirements.txt in this directory.

Use your distribution's package manager to install the following build tools:

patch patchelf Depending on which package you're building, you may also need additional tools. Most of these can be installed using your distribution. Some of them have special entries in the build requirements section of meta.yaml:

fortran: You must install the Fortran compiler from here. Create a fortran subdirectory in the same directory as this README, and unpack the .bz2 files into it.

Is there any example of this step-by-step process?

thanks

mhsmith commented 1 day ago

I'm not sure how I can make these instructions any clearer. But there's no need to install Fortran unless the package actually needs it, which is unlikely.