尝试设置chaquopy时出现错误(错误读取:无法启动(org.gradle.process.internal.ExecException)

时间:2019-01-17 15:26:30

标签: android chaquopy

This is the screenshot of the error

当我尝试使用macOS和python 3.6设置chaquopy时遇到此错误。

我正在setting up chaquopy的“要求”步骤中。我已经添加了插件,进行了ABI选择,开发和要求。

遇到的错误是:

failed to start (org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/usr/local/lib/python3.6'') Please set python.buildPython to your Python executable path.

我的build.gradle在下面:

apply plugin: 'com.chaquo.python'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.vishrutjaipuria.facialrecognition"
        minSdkVersion 27
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
        python {
            buildPython "/usr/local/lib/python3.6"
        }
        python {
            pip {
                install "scipy==1.0.1"
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
android {
    flavorDimensions "abi"
    productFlavors {
        arm {
            dimension "abi"
            ndk { abiFilters "armeabi-v7a" }
        }
        x86 {
            dimension "abi"
            ndk { abiFilters "x86" }
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

1 个答案:

答案 0 :(得分:0)

正如the documentation所说,buildPython应该设置为Python可执行文件,而不是Python库目录。将其设置为可执行路径:可能是/usr/local/bin/python3.6,但请先检查一下自己。