这个 Gradle: 应用文件代码:
apply plugin: 'com.android.application'
apply plugin: 'com.chaquo.python'
android {
compileSdkVersion 29
buildToolsVersion "30.0.1"
defaultConfig {
applicationId "com.example.speechtotext"
sourceSets{
main{
python{
srcDirs=["src/main/python"]
}
}
}
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
abiFilters "armeabi-v7a", "x86"
}
python{
buildPython "C:/Users/YASHWANTH REDDY/AppData/Local/Programs/Python/Python37/python.exe"}
}
python{
pip{
install "nltk"
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
compile files('libs/opennlp-tools-1.6.0.jar')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
这是 Gradle:(android 中的 python)
buildscript {
repositories {
google()
jcenter()
maven { url "https://chaquo.com/maven" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "com.chaquo.python:gradle:9.0.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
centre()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我已经链接了所有插件,正如 chaquopy 官方文档中提到的那样,我收到以下错误。
enter code here
A problem occurred starting process 'command 'C:/Users/YASHWANTH''. Please set buildPython to your Python executable path. See https://chaquo.com/chaquopy/doc/current/android.html#buildpython.
删除时我没有收到上述错误
python{
pip{
install "nltk"
}
}
所以请帮助我为什么在尝试安装任何 python 库时出现上述错误,