-1

This is the screenshot of the error

I am getting this error when I am trying to setup chaquopy, using macOS and python 3.6.

I am on the Requirements step on setting up chaquopy. I have added the plugin, did ABI selection, development, requirements.

The error encountered is:

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.

My build.gradle is below:

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'
}
0

2 Answers 2

0

As the documentation says, buildPython should be set to the Python executable, not the Python library directory. Set it to the executable path: this is probably /usr/local/bin/python3.6, but check for yourself first.

0

I also faced a similar error (A problem occurred starting process 'command '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/os.py''. Please set buildPython to your Python executable path. ) while trying (by the statement starting with buildPython) to set the location of the Python executable file in Android Studio installed in a Macbook.

Way to solve the problem

One of the ways to solve the problem can be by setting the exact location of the Python executable file. But I do not see any necessity to set the location manually since Chaquopy will try to find Python on the PATH with the standard command for the OS as mentioned here. Therefore, just removing the statement (buildPython "/usr/local/lib/python3.6" something like that presenting a location) solved my problem since I installed Python on Mac earlier and Chaquopy got (as far as I understood) the location of the exe file through standard command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.