chaquo / chaquopy

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

Trying to use datasets module, "Failed to install xxhash" #1101

Open marcoaag01 opened 7 months ago

marcoaag01 commented 7 months ago

Chaquopy version

15.0

Relevant parts of your build.gradle file

plugins { id("com.android.application") id("com.chaquo.python") }

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

defaultConfig {
    ndk {
        // On Apple silicon, you can omit x86_64.
        abiFilters += listOf("arm64-v8a", "x86_64")
    }
    applicationId = "com.example.apptesis"
    minSdk = 24
    targetSdk = 34
    versionCode = 1
    versionName = "1.0"

    testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

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

}

chaquopy { defaultConfig { pip{ install("numpy") install("matplotlib") install("pandas") install("scipy") install("scikit-learn") install("keras") install("opencv-python") install("pillow") install("pytesseract") install("imutils") install("transformers==4.11.3") install("torch") install("tokenizers") install("wave") install("datasets==1.14.0") install("soundfile")

        install("ffmpeg-python")
        install("librosa==0.9.2")
        install("resampy==0.3.1")
        install("msgpack==1.0.6")
    }
    pyc {
        src = false
    }

    version = "3.8"
}

}

dependencies {

implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.11.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.cardview:cardview:1.0.0")
implementation("androidx.recyclerview:recyclerview:1.3.2")
implementation("com.google.android.material:material:1.11.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")

} dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() maven("https://chaquo.com/maven") } } // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { id("com.android.application") version "8.2.2" apply false id("com.android.library") version "8.2.2" apply false id("com.chaquo.python") version "15.0.1" apply false }

Describe your issue

Failed to install xxhash from https://files.pythonhosted.org/packages/04/ef/1a95dc97a71b128a7c5fd531e42574b274629a4ad1354a694087e2305467/xxhash-3.4.1.tar.gz#sha256=0379d6cf1ff987cd421609a264ce025e74f346e3e145dd106c0cc2e3ec3f99a9 (from datasets==1.14.0).

mhsmith commented 7 months ago

xxhash 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.

However, it looks like all versions of the datasets package also require pyarrow, which would be more difficult to build (#482).