Tiktoken is for EM_X86_64 | ImportError: dlopen failed ()
Closed this issue · 14 comments
The issue is indeed a bug and not a support request.
I have a short, runnable example that reproduces the issue.
I used the grave accent (aka backticks) to format code or logs when appropriated.
Versions
- Python: 3.11.5
- OS: Ubuntu
- Kivy: 2.3.0
- Cython: 3.0.11
Description
I'm trying to use the tiktoken
library in my Android app built with Python-for-Android. After building the APK and running it on my device, I get the following error:
ImportError: dlopen failed: "/data/data/org.test.sensory_app/files/app/_python_bundle/site-packages/tiktoken/_tiktoken.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183)
This error means that the _tiktoken.so
library, which is a native library compiled for ARM64 architecture, is not compatible with my device's architecture (ARM64). It seems like the library was compiled for x86_64 instead of ARM64.
I believe that a recipe for tiktoken
is needed to properly build and install it for Android.
buildozer.spec
Command:
buildozer android debug
Spec file:
[app]
title = SensoryContext
package.name = sensory_app
package.domain = org.test
android.private_storage = True
source.dir = .
source.includes = Plugin/*
version = 0.1
source.include_exts = json
entrypoint = main.py
requirements = python3,kivy,kivymd,setuptools-rust>=1.5.2,setuptools>=62.4,python-telegram-bot>=21.4,openai,httpx,pillow,pydub,tenacity,sniffio,httpcore,h11,trio,socksio,regex>=2022.1.18,requests>=2.26.0, tiktoken
android.permissions = INTERNET,WRITE_EXTERNAL_STORAGE
android.ndk = 25b
android.ndk_api = 21
android.archs = arm64-v8a
android.cflags = -Wno-cast-function-type-strict
[buildozer]
log_level = 2
warn_on_root = 1
I would be very grateful if you could create a recipe for tiktoken
to solve this issue.
I believe that a recipe for tiktoken is needed to properly build and install it for Android.
yes, because ticktoken contains this Rust code https://github.com/openai/tiktoken/blob/main/src/lib.rs
As far as I know there are no examples of p4a recipes using Rust.
I have written a recipe, but I can't seem to make any progress. Perhaps I am going in the wrong direction, and all my efforts are in vain. Can you please provide some guidance?
Here is the recipe for tiktoken that doesn't work but fails at the stage of building pyo3-ffi v0.20.3
:
from pythonforandroid.recipe import Recipe
from pythonforandroid.toolchain import shprint, current_directory
from pythonforandroid.archs import Arch
from os.path import join, exists
import sh, os
class TiktokenRecipe(Recipe):
version = "0.7.0"
url = "https://github.com/openai/tiktoken/archive/refs/tags/{version}.tar.gz"
depends = ['python3', 'rust', 'setuptools', 'setuptools-rust', 'wheel', 'requests'] #[ 'python3', 'pyo3', 'requests']
site_packages_name = 'tiktoken'
def should_build(self, arch: Arch):
# Check if the _tiktoken.so file exists
build_dir = self.get_build_dir(arch.arch)
so_file = join(build_dir, 'target', 'aarch64-linux-android', 'release', '_tiktoken.so')
if exists(so_file):
print(f"Found existing _tiktoken.so in {so_file}, skipping build.")
return False
return True
def get_recipe_env(self, arch: Arch):
env = super().get_recipe_env(arch)
env['ANDROID_NDK_HOME'] = self.ctx.ndk_dir
env['CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER'] = join(self.ctx.ndk_dir, "toolchains/llvm/prebuilt/linux-x86_64/bin/clang")
# Setting environment variables for PyO3
env['PYO3_CROSS'] = '1'
env['PYO3_CROSS_PYTHON_VERSION'] = '3.11'
env['PYO3_CROSS_LIB_DIR'] = join(self.ctx.get_python_install_dir(arch.arch), 'lib')
env['PYO3_CROSS_PYTHON_IMPLEMENTATION'] = 'CPython'
# Setting environment variables for Rust
env['RUSTUP_HOME'] = join(self.ctx.build_dir, 'rustup')
env['CARGO_HOME'] = join(self.ctx.build_dir, 'cargo')
env['PATH'] = f"{env['PATH']}:{env['CARGO_HOME']}/bin:{env['RUSTUP_HOME']}/bin"
# Setting environment variables for the app
env['TARGET_CC'] = join(self.ctx.ndk_dir, 'toolchains/llvm/prebuilt/linux-x86_64/bin/clang')
env['TARGET_CXX'] = join(self.ctx.ndk_dir, 'toolchains/llvm/prebuilt/linux-x86_64/bin/clang++')
env['TARGET_AR'] = join(self.ctx.ndk_dir, 'toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar')
env['TARGET_LD'] = join(self.ctx.ndk_dir, 'toolchains/llvm/prebuilt/linux-x86_64/bin/ld')
# Setting environment variables for debugging
env['RUST_BACKTRACE'] = 'full'
env['CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG'] = 'true'
shprint(sh.Command('pip'), 'list', _env=env)
# Additional debug information
print(f"Env: {env}")
return env
def prebuild_arch(self, arch: Arch):
super().prebuild_arch(arch)
env = self.get_recipe_env(arch)
# Setting target platforms for Rust
shprint(sh.Command('rustup'), 'default', 'stable', _env=env)
shprint(sh.Command('rustup'), 'target', 'add', 'aarch64-linux-android', _env=env)
shprint(sh.Command('rustup'), 'target', 'add', 'armv7-linux-androideabi', _env=env)
shprint(sh.Command('rustup'), 'target', 'list', '--installed', _env=env)
cargo_toml_path = '/home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/tiktoken/Cargo.toml' # join(self.get_build_dir(arch.arch), 'Cargo.toml')
if not exists(cargo_toml_path):
raise FileNotFoundError(f"Cargo.toml not found: {cargo_toml_path}")
def build_arch(self, arch: Arch):
super().build_arch(arch)
with current_directory(self.get_build_dir(arch.arch)):
env = self.get_recipe_env(arch)
env['PYTHON_ROOT'] = self.ctx.get_python_install_dir(arch.arch)
print(env['PYTHON_ROOT'], '##########################')
# Checking the presence of all necessary directories and files
print(self.ctx.get_python_install_dir(arch.arch))
# python_lib_dir = join(self.ctx.get_python_install_dir(arch.arch), 'lib')
# if not exists(python_lib_dir):
# raise FileNotFoundError(f"Python lib directory not found: {python_lib_dir}")
# Using cargo-ndk to build for Android
cargo_toml_path = join(self.get_build_dir(arch.arch), 'Cargo.toml')
if not exists(cargo_toml_path):
raise FileNotFoundError(f"Cargo.toml not found: {cargo_toml_path}")
# Adding dependencies to Cargo.toml
# with open(cargo_toml_path, 'a') as cargo_toml:
# cargo_toml.write('\n[target.aarch64-linux-android.dependencies]\n')
# cargo_toml.write('pyo3 = { version = "0.20.3", features = ["extension-module"] }\n')
shprint(sh.Command('cargo'), 'ndk', '--manifest-path', cargo_toml_path, 'build', '--target', 'aarch64-linux-android', '--release', _env=env)
# Using cargo-ndk to build for Android
# shprint(sh.Command('cargo'), 'ndk', '--manifest-path', cargo_toml_path, 'build', '--target', 'aarch64-linux-android', '--release', _env=env)
self.install_libs(arch, join('target', 'aarch64-linux-android/release', '_tiktoken.so'))
recipe = TiktokenRecipe()
Here are the logs:
�[1m[INFO]�[0m: �[36m-> directory context /home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/tiktoken/arm64-v8a__ndk_target_21/tiktoken�[39m
�[1m�[90m[DEBUG]�[39m�[0m: �[90m->�[0m running pip list�[0m
�[1m�[90m[DEBUG]�[39m�[0m: Package Version
�[1m�[90m[DEBUG]�[39m�[0m: ------------------- -----------
�[1m�[90m[DEBUG]�[39m�[0m: annotated-types 0.7.0
�[1m�[90m[DEBUG]�[39m�[0m: anyio 4.4.0
�[1m�[90m[DEBUG]�[39m�[0m: appdirs 1.4.4
�[1m�[90m[DEBUG]�[39m�[0m: asttokens 2.4.1
�[1m�[90m[DEBUG]�[39m�[0m: attrs 24.2.0
�[1m�[90m[DEBUG]�[39m�[0m: build 1.2.1
�[1m�[90m[DEBUG]�[39m�[0m: buildozer 1.5.0
�[1m�[90m[DEBUG]�[39m�[0m: certifi 2024.7.4
�[1m�[90m[DEBUG]�[39m�[0m: charset-normalizer 3.3.2
�[1m�[90m[DEBUG]�[39m�[0m: colorama 0.4.6
�[1m�[90m[DEBUG]�[39m�[0m: comm 0.2.2
�[1m�[90m[DEBUG]�[39m�[0m: Cython 3.0.11
�[1m�[90m[DEBUG]�[39m�[0m: debugpy 1.8.5
�[1m�[90m[DEBUG]�[39m�[0m: decorator 5.1.1
�[1m�[90m[DEBUG]�[39m�[0m: distlib 0.3.8
�[1m�[90m[DEBUG]�[39m�[0m: distro 1.9.0
�[1m�[90m[DEBUG]�[39m�[0m: docutils 0.21.2
�[1m�[90m[DEBUG]�[39m�[0m: executing 2.0.1
�[1m�[90m[DEBUG]�[39m�[0m: filelock 3.15.4
�[1m�[90m[DEBUG]�[39m�[0m: h11 0.14.0
�[1m�[90m[DEBUG]�[39m�[0m: httpcore 1.0.5
�[1m�[90m[DEBUG]�[39m�[0m: httpx 0.27.0
�[1m�[90m[DEBUG]�[39m�[0m: idna 3.7
�[1m�[90m[DEBUG]�[39m�[0m: ipykernel 6.29.5
�[1m�[90m[DEBUG]�[39m�[0m: ipython 8.26.0
�[1m�[90m[DEBUG]�[39m�[0m: jedi 0.19.1
�[1m�[90m[DEBUG]�[39m�[0m: Jinja2 3.1.4
�[1m�[90m[DEBUG]�[39m�[0m: jiter 0.5.0
�[1m�[90m[DEBUG]�[39m�[0m: jupyter_client 8.6.2
�[1m�[90m[DEBUG]�[39m�[0m: jupyter_core 5.7.2
�[1m�[90m[DEBUG]�[39m�[0m: Kivy 2.3.0
�[1m�[90m[DEBUG]�[39m�[0m: Kivy-Garden 0.1.5
�[1m�[90m[DEBUG]�[39m�[0m: kivymd 1.2.0
�[1m�[90m[DEBUG]�[39m�[0m: MarkupSafe 2.1.5
�[1m�[90m[DEBUG]�[39m�[0m: matplotlib-inline 0.1.7
�[1m�[90m[DEBUG]�[39m�[0m: nest-asyncio 1.6.0
�[1m�[90m[DEBUG]�[39m�[0m: openai 1.41.0
�[1m�[90m[DEBUG]�[39m�[0m: outcome 1.3.0.post0
�[1m�[90m[DEBUG]�[39m�[0m: packaging 24.1
�[1m�[90m[DEBUG]�[39m�[0m: parso 0.8.4
�[1m�[90m[DEBUG]�[39m�[0m: pexpect 4.9.0
�[1m�[90m[DEBUG]�[39m�[0m: pillow 10.4.0
�[1m�[90m[DEBUG]�[39m�[0m: pip 23.2.1
�[1m�[90m[DEBUG]�[39m�[0m: platformdirs 4.2.2
�[1m�[90m[DEBUG]�[39m�[0m: prompt_toolkit 3.0.47
�[1m�[90m[DEBUG]�[39m�[0m: psutil 6.0.0
�[1m�[90m[DEBUG]�[39m�[0m: ptyprocess 0.7.0
�[1m�[90m[DEBUG]�[39m�[0m: pure_eval 0.2.3
�[1m�[90m[DEBUG]�[39m�[0m: pydantic 2.8.2
�[1m�[90m[DEBUG]�[39m�[0m: pydantic_core 2.20.1
�[1m�[90m[DEBUG]�[39m�[0m: pydub 0.25.1
�[1m�[90m[DEBUG]�[39m�[0m: Pygments 2.18.0
�[1m�[90m[DEBUG]�[39m�[0m: pyproject_hooks 1.1.0
�[1m�[90m[DEBUG]�[39m�[0m: python-dateutil 2.9.0.post0
�[1m�[90m[DEBUG]�[39m�[0m: python-for-android 0.7.0
�[1m�[90m[DEBUG]�[39m�[0m: python-telegram-bot 21.4
�[1m�[90m[DEBUG]�[39m�[0m: pyzmq 26.1.0
�[1m�[90m[DEBUG]�[39m�[0m: regex 2024.7.24
�[1m�[90m[DEBUG]�[39m�[0m: requests 2.32.3
�[1m�[90m[DEBUG]�[39m�[0m: semantic-version 2.10.0
�[1m�[90m[DEBUG]�[39m�[0m: setuptools 65.5.0
�[1m�[90m[DEBUG]�[39m�[0m: setuptools-rust 1.10.1
�[1m�[90m[DEBUG]�[39m�[0m: sh 1.14.3
�[1m�[90m[DEBUG]�[39m�[0m: six 1.16.0
�[1m�[90m[DEBUG]�[39m�[0m: sniffio 1.3.1
�[1m�[90m[DEBUG]�[39m�[0m: socksio 1.0.0
�[1m�[90m[DEBUG]�[39m�[0m: sortedcontainers 2.4.0
�[1m�[90m[DEBUG]�[39m�[0m: stack-data 0.6.3
�[1m�[90m[DEBUG]�[39m�[0m: tenacity 9.0.0
�[1m�[90m[DEBUG]�[39m�[0m: tiktoken 0.7.0
�[1m�[90m[DEBUG]�[39m�[0m: toml 0.10.2
�[1m�[90m[DEBUG]�[39m�[0m: tornado 6.4.1
�[1m�[90m[DEBUG]�[39m�[0m: tqdm 4.66.5
�[1m�[90m[DEBUG]�[39m�[0m: traitlets 5.14.3
�[1m�[90m[DEBUG]�[39m�[0m: trio 0.26.2
�[1m�[90m[DEBUG]�[39m�[0m: typing_extensions 4.12.2
�[1m�[90m[DEBUG]�[39m�[0m: urllib3 2.2.2
�[1m�[90m[DEBUG]�[39m�[0m: virtualenv 20.26.3
�[1m�[90m[DEBUG]�[39m�[0m: wcwidth 0.2.13
�[1m�[90m[DEBUG]�[39m�[0m:
�[1m�[90m[DEBUG]�[39m�[0m: �[1m[�[0m�[34;49mnotice�[0m�[1;39;49m]�[0m�[39;49m A new release of pip is available: �[0m�[31;49m23.2.1�[0m�[39;49m -> �[0m�[32;49m24.2�[0m
�[1m�[90m[DEBUG]�[39m�[0m: �[1m[�[0m�[34;49mnotice�[0m�[1;39;49m]�[0m�[39;49m To update, run: �[0m�[32;49mpip install --upgrade pip�[0m
Env: {'HOME': '/home/fox', 'CFLAGS': '-target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC', 'CXXFLAGS': '-target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC', 'CPPFLAGS': '-DANDROID -I/home/fox/GPT_bot/libs/ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/sensory_app/arm64-v8a/include/python3.1', 'LDFLAGS': ' -L/home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/libs_collections/sensory_app/arm64-v8a', 'LDLIBS': '-lm', 'PATH': '/home/fox/GPT_bot/libs/ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin:/home/fox/GPT_bot/libs/ndk/android-ndk-r25b:/home/fox/.buildozer/android/platform/android-sdk/tools:/home/fox/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/fox/GPT_bot/SensoryContextAndroid/.venv/bin:/usr/bin:/usr/local/bin:/home/fox/.nvm/versions/node/v18.17.0/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/fox/.vscode-server/cli/servers/Stable-eaa41d57266683296de7d118f574d0c2652e1fc4/server/bin/remote-cli:/home/fox/.local/bin:/usr/local/bin:/home/fox/.cargo/bin:/home/fox/.nvm/versions/node/v18.17.0/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/fox/android-sdk/cmdline-tools/latest/bin:/home/fox/android-sdk/cmdline-tools/latest/bin:/home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/cargo/bin:/home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/rustup/bin', 'CC': '/home/fox/GPT_bot/libs/ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC', 'CXX': '/home/fox/GPT_bot/libs/ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC', 'AR': '/home/fox/GPT_bot/libs/ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar', 'RANLIB': '/home/fox/GPT_bot/libs/ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib', 'STRIP': '/home/fox/GPT_bot/libs/ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --strip-unneeded', 'READELF': '/home/fox/GPT_bot/libs/ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-readelf', 'OBJCOPY': '/home/fox/GPT_bot/libs/ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-objcopy', 'MAKE': 'make -j12', 'ARCH': 'arm64-v8a', 'NDK_API': 'android-21', 'LDSHARED': '/home/fox/GPT_bot/libs/ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions', 'BUILDLIB_PATH': '/home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/build/lib.linux-x86_64-3.11', 'ANDROID_NDK_HOME': '/home/fox/GPT_bot/libs/ndk/android-ndk-r25b', 'CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER': '/home/fox/GPT_bot/libs/ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang', 'PYO3_CROSS': '1', 'PYO3_CROSS_PYTHON_VERSION': '3.11', 'PYO3_CROSS_LIB_DIR': '/home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/sensory_app/arm64-v8a/lib', 'PYO3_CROSS_PYTHON_IMPLEMENTATION': 'CPython', 'RUSTUP_HOME': '/home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/rustup', 'CARGO_HOME': '/home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/cargo', 'TARGET_CC': '/home/fox/GPT_bot/libs/ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang', 'TARGET_CXX': '/home/fox/GPT_bot/libs/ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++', 'TARGET_AR': '/home/fox/GPT_bot/libs/ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar', 'TARGET_LD': '/home/fox/GPT_bot/libs/ndk/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/ld', 'RUST_BACKTRACE': 'full', 'CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG': 'true'}
�[1m�[90m[DEBUG]�[39m�[0m: �[90m->�[0m running cargo ndk --manifest-path /home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/tiktoken/arm64-v8a__ndk_target_21/tiktoken/Cargo.toml build --target aarch64-linux-android --release�[0m
�[1m�[90m[DEBUG]�[39m�[0m: Building armeabi-v7a (armv7-linux-androideabi)
�[1m�[90m[DEBUG]�[39m�[0m: Updating crates.io index
�[1m�[90m[DEBUG]�[39m�[0m: Fetch [=====> ] 0 complete; 1 pending
Fetch [===========> ] 1 complete; 5 pending
Fetch [=================> ] 12 complete; 12 pending
Fetch [====================> ] 24 complete; 9 pending
Fetch [=======================> ] 37 complete; 1 pending
Locking 48 packages to latest compatible versions
�[1m�[90m[DEBUG]�[39m�[0m: Adding bit-set v0.5.3 (latest: v0.8.0)
�[1m�[90m[DEBUG]�[39m�[0m: Adding bit-vec v0.6.3 (latest: v0.8.0)
�[1m�[90m[DEBUG]�[39m�[0m: Adding fancy-regex v0.11.0 (latest: v0.13.0)
�[1m�[90m[DEBUG]�[39m�[0m: Adding heck v0.4.1 (latest: v0.5.0)
�[1m�[90m[DEBUG]�[39m�[0m: Adding pyo3 v0.20.3 (latest: v0.22.2)
�[1m�[90m[DEBUG]�[39m�[0m: Adding pyo3-build-config v0.20.3 (latest: v0.22.2)
�[1m�[90m[DEBUG]�[39m�[0m: Adding pyo3-ffi v0.20.3 (latest: v0.22.2)
�[1m�[90m[DEBUG]�[39m�[0m: Adding pyo3-macros v0.20.3 (latest: v0.22.2)
�[1m�[90m[DEBUG]�[39m�[0m: Adding pyo3-macros-backend v0.20.3 (latest: v0.22.2)
�[1m�[90m[DEBUG]�[39m�[0m: Adding rustc-hash v1.1.0 (latest: v2.0.0)
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 1 crate
Downloading 2 crates
Downloading 3 crates
Downloading 4 crates
Downloading 5 crates
Downloading 6 crates
Downloading 7 crates
Downloading 8 crates
Downloading 9 crates
Downloading 10 crates
Downloading 11 crates
Downloading 12 crates
Downloading 13 crates
Downloading 14 crates
Downloading 15 crates
Downloading 16 crates
Downloading 17 crates
Downloading 18 crates
Downloading 19 crates
Downloading 20 crates
Downloading 21 crates
Downloading 22 crates
Downloading 23 crates
Downloading 24 crates
Downloading 25 crates
Downloading 26 crates
Downloading 27 crates
Downloading 28 crates
Downloading 29 crates
Downloading 30 crates
Downloading 31 crates
Downloading 32 crates
Downloading 33 crates
Downloading 34 crates
Downloading 35 crates
Downloaded bit-vec v0.6.3
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 34 crates
Downloading 34 crates, remaining bytes: 1.4 MB
Downloaded cfg-if v1.0.0
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 33 crates, remaining bytes: 1.3 MB
Downloaded heck v0.4.1
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 32 crates, remaining bytes: 1.2 MB
Downloaded autocfg v1.3.0
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 31 crates, remaining bytes: 1.2 MB
Downloaded indoc v2.0.5
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 30 crates, remaining bytes: 1.2 MB
Downloaded bit-set v0.5.3
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 29 crates, remaining bytes: 1.2 MB
Downloaded unindent v0.2.3
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 28 crates, remaining bytes: 3.7 MB
Downloaded fancy-regex v0.11.0
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 27 crates, remaining bytes: 3.6 MB
Downloaded pyo3-macros v0.20.3
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 26 crates, remaining bytes: 3.6 MB
Downloaded rustc-hash v1.1.0
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 25 crates, remaining bytes: 3.5 MB
Downloaded scopeguard v1.2.0
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 24 crates, remaining bytes: 3.3 MB
Downloaded memoffset v0.9.1
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 23 crates, remaining bytes: 3.3 MB
Downloaded quote v1.0.36
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 22 crates, remaining bytes: 3.2 MB
Downloaded once_cell v1.19.0
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 21 crates, remaining bytes: 3.2 MB
Downloaded pyo3-build-config v0.20.3
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 20 crates, remaining bytes: 3.2 MB
Downloaded parking_lot_core v0.9.10
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 19 crates, remaining bytes: 3.1 MB
Downloaded parking_lot v0.12.3
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 18 crates, remaining bytes: 3.1 MB
Downloaded lock_api v0.4.12
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 17 crates, remaining bytes: 3.1 MB
Downloaded smallvec v1.13.2
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 16 crates, remaining bytes: 3.0 MB
Downloaded target-lexicon v0.12.16
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 15 crates, remaining bytes: 3.0 MB
Downloaded proc-macro2 v1.0.86
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 14 crates, remaining bytes: 2.9 MB
Downloaded unicode-ident v1.0.12
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 13 crates, remaining bytes: 2.9 MB
Downloaded pyo3-macros-backend v0.20.3
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 12 crates, remaining bytes: 2.6 MB
Downloaded pyo3-ffi v0.20.3
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 11 crates, remaining bytes: 2.6 MB
Downloaded serde v1.0.208
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 10 crates, remaining bytes: 2.4 MB
Downloaded memchr v2.7.4
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 9 crates, remaining bytes: 2.4 MB
Downloaded aho-corasick v1.1.3
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 8 crates, remaining bytes: 2.2 MB
Downloaded portable-atomic v1.7.0
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 7 crates, remaining bytes: 1.9 MB
Downloading 7 crates, remaining bytes: 1.4 MB
Downloaded regex v1.10.6
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 6 crates, remaining bytes: 1.1 MB
Downloaded syn v2.0.75
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 5 crates, remaining bytes: 997.9 KB
Downloaded bstr v1.10.0
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 4 crates, remaining bytes: 801.4 KB
Downloaded regex-syntax v0.8.4
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 3 crates, remaining bytes: 688.7 KB
Downloaded pyo3 v0.20.3
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 2 crates, extracting pyo3 ...
Downloaded regex-automata v0.4.7
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 1 crate, extracting regex-automata ...
Downloaded libc v0.2.156
�[1m�[90m[DEBUG]�[39m�[0m: Downloading 0 crates, extracting libc ...
Downloaded 35 crates (4.2 MB) in 1.38s
�[1m�[90m[DEBUG]�[39m�[0m: Compiling target-lexicon v0.12.16
�[1m�[90m[DEBUG]�[39m�[0m: Compiling autocfg v1.3.0
�[1m�[90m[DEBUG]�[39m�[0m: Compiling once_cell v1.19.0
�[1m�[90m[DEBUG]�[39m�[0m: Compiling libc v0.2.156
�[1m�[90m[DEBUG]�[39m�[0m: Compiling proc-macro2 v1.0.86
�[1m�[90m[DEBUG]�[39m�[0m: Compiling parking_lot_core v0.9.10
�[1m�[90m[DEBUG]�[39m�[0m: Compiling unicode-ident v1.0.12
�[1m�[90m[DEBUG]�[39m�[0m: Compiling portable-atomic v1.7.0
�[1m�[90m[DEBUG]�[39m�[0m: Compiling heck v0.4.1
�[1m�[90m[DEBUG]�[39m�[0m: Compiling memchr v2.7.4
�[1m�[90m[DEBUG]�[39m�[0m: Compiling regex-syntax v0.8.4
�[1m�[90m[DEBUG]�[39m�[0m: Building [ ] 0/85: heck, once_cell, memchr, ...
Building [ ] 1/85: heck, once_cell, memchr, ...
Compiling indoc v2.0.5
�[1m�[90m[DEBUG]�[39m�[0m: Building [ ] 2/85: heck, memchr, regex-synta...
Compiling scopeguard v1.2.0
�[1m�[90m[DEBUG]�[39m�[0m: Building [ ] 3/85: memchr, scopeguard, regex...
Compiling cfg-if v1.0.0
�[1m�[90m[DEBUG]�[39m�[0m: Building [> ] 4/85: cfg-if, memchr, regex-syn...
Building [> ] 5/85: cfg-if, parking_lot_core(...
Building [> ] 6/85: cfg-if, parking_lot_core(...
Building [=> ] 7/85: cfg-if, scopeguard, memch...
Compiling smallvec v1.13.2
�[1m�[90m[DEBUG]�[39m�[0m: Building [=> ] 8/85: scopeguard, memchr, regex...
Building [=> ] 9/85: cfg-if, memchr, regex-syn...
Building [==> ] 10/85: smallvec, memchr, regex-s...
Building [==> ] 11/85: smallvec, proc-macro2(bui...
Building [==> ] 12/85: smallvec, proc-macro2(bui...
Building [===> ] 13/85: smallvec, proc-macro2(bui...
Building [===> ] 14/85: smallvec, memchr, proc-ma...
Building [===> ] 15/85: smallvec, memchr, proc-ma...
Compiling lock_api v0.4.12
�[1m�[90m[DEBUG]�[39m�[0m: Building [====> ] 16/85: smallvec, memchr, proc-ma...
Compiling memoffset v0.9.1
�[1m�[90m[DEBUG]�[39m�[0m: Building [====> ] 17/85: smallvec, memchr, proc-ma...
Compiling aho-corasick v1.1.3
�[1m�[90m[DEBUG]�[39m�[0m: Building [====> ] 18/85: smallvec, memchr, proc-ma...
Building [=====> ] 19/85: smallvec, target-lexicon(...
Building [=====> ] 20/85: target-lexicon(build), me...
Building [=====> ] 21/85: memchr, target-lexicon, p...
Building [=====> ] 22/85: libc, memchr, target-lexi...
Building [======> ] 23/85: libc, memchr, target-lexi...
Building [======> ] 24/85: libc, memchr, target-lexi...
Building [======> ] 25/85: libc, memchr, target-lexi...
Building [=======> ] 26/85: libc, memchr, target-lexi...
Building [=======> ] 27/85: lock_api, libc, memchr, t...
Building [=======> ] 28/85: lock_api, libc, memchr, t...
Compiling quote v1.0.36
�[1m�[90m[DEBUG]�[39m�[0m: Building [========> ] 29/85: lock_api, libc, memchr, t...
Building [========> ] 30/85: lock_api, libc, memchr, t...
Building [========> ] 31/85: lock_api, libc, portable-...
Building [=========> ] 32/85: lock_api, libc, portable-...
Compiling bit-vec v0.6.3
�[1m�[90m[DEBUG]�[39m�[0m: Building [=========> ] 33/85: lock_api, libc, bit-vec, ...
Building [=========> ] 34/85: lock_api, libc, bit-vec, ...
Compiling pyo3-build-config v0.20.3
�[1m�[90m[DEBUG]�[39m�[0m: Building [==========> ] 35/85: lock_api, libc, bit-vec, ...
Building [==========> ] 36/85: lock_api, parking_lot_cor...
Compiling syn v2.0.75
�[1m�[90m[DEBUG]�[39m�[0m: Building [==========> ] 37/85: syn, parking_lot_core, bi...
Compiling parking_lot v0.12.3
�[1m�[90m[DEBUG]�[39m�[0m: Building [===========> ] 38/85: syn, parking_lot_core, pa...
Compiling bit-set v0.5.3
�[1m�[90m[DEBUG]�[39m�[0m: Building [===========> ] 39/85: syn, parking_lot_core, pa...
Building [===========> ] 40/85: syn, parking_lot_core, pa...
Building [============> ] 41/85: syn, parking_lot_core, pa...
Building [============> ] 42/85: syn, parking_lot_core, pa...
Building [============> ] 43/85: syn, parking_lot_core, pa...
Building [============> ] 44/85: syn, parking_lot_core, pa...
Building [=============> ] 45/85: syn, parking_lot, portabl...
Compiling unindent v0.2.3
�[1m�[90m[DEBUG]�[39m�[0m: Building [=============> ] 46/85: syn, parking_lot, portabl...
Building [=============> ] 47/85: syn, parking_lot, portabl...
Compiling rustc-hash v1.1.0
�[1m�[90m[DEBUG]�[39m�[0m: Building [==============> ] 48/85: syn, rustc-hash, parking_...
Building [==============> ] 49/85: syn, rustc-hash, parking_...
Building [==============> ] 50/85: syn, parking_lot, portabl...
Building [===============> ] 51/85: syn, parking_lot, portabl...
Building [===============> ] 52/85: syn, parking_lot, portabl...
Building [===============> ] 53/85: syn, parking_lot, regex-s...
Building [================> ] 54/85: syn, regex-syntax, parkin...
Compiling regex-automata v0.4.7
�[1m�[90m[DEBUG]�[39m�[0m: Building [================> ] 55/85: syn, regex-automata, rege...
Building [================> ] 56/85: syn, regex-automata, rege...
Building [=================> ] 57/85: syn, regex-automata, rege...
Building [=================> ] 58/85: syn, regex-automata, rege...
Building [=================> ] 59/85: syn, regex-automata, rege...
Compiling pyo3-ffi v0.20.3
�[1m�[90m[DEBUG]�[39m�[0m: Building [==================> ] 60/85: syn, regex-automata, pyo3...
Compiling pyo3 v0.20.3
�[1m�[90m[DEBUG]�[39m�[0m: Building [==================> ] 61/85: syn, regex-automata, rege...
Compiling pyo3-macros-backend v0.20.3
�[1m�[90m[DEBUG]�[39m�[0m: Building [==================> ] 62/85: syn, regex-automata, rege...
Building [===================> ] 63/85: syn, regex-automata, rege...
**error: failed to run custom build command for `pyo3-ffi v0.20.3`**
�[1m�[90m[DEBUG]�[39m�[0m:
�[1m�[90m[DEBUG]�[39m�[0m: Caused by:
�[1m�[90m[DEBUG]�[39m�[0m: process didn't exit successfully: `/home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/tiktoken/arm64-v8a__ndk_target_21/tiktoken/target/release/build/pyo3-ffi-e24b2e6e6fec1da9/build-script-build` (exit status: 101)
�[1m�[90m[DEBUG]�[39m�[0m: --- stdout
�[1m�[90m[DEBUG]�[39m�[0m: cargo:rerun-if-env-changed=PYO3_CROSS
�[1m�[90m[DEBUG]�[39m�[0m: cargo:rerun-if-env-changed=PYO3_CROSS_LIB_DIR
�[1m�[90m[DEBUG]�[39m�[0m: cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_VERSION
�[1m�[90m[DEBUG]�[39m�[0m: cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_IMPLEMENTATION
�[1m�[90m[DEBUG]�[39m�[0m: cargo:rerun-if-env-changed=PYO3_NO_PYTHON
�[1m�[90m[DEBUG]�[39m�[0m:
�[1m�[90m[DEBUG]�[39m�[0m: --- stderr
�[1m�[90m[DEBUG]�[39m�[0m: thread 'main' panicked at /home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-build-config-0.20.3/src/impl_.rs:1286:33:
�[1m�[90m[DEBUG]�[39m�[0m: Path does not exist: Os { code: 2, kind: NotFound, message: "No such file or directory" }
�[1m�[90m[DEBUG]�[39m�[0m: stack backtrace:
�[1m�[90m[DEBUG]�[39m�[0m: 0: 0x635c5cb53be5 - std::backtrace_rs::backtrace::libunwind::trace::h23054e327d0d4b55
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
�[1m�[90m[DEBUG]�[39m�[0m: 1: 0x635c5cb53be5 - std::backtrace_rs::backtrace::trace_unsynchronized::h0cc587407d7f7f64
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
�[1m�[90m[DEBUG]�[39m�[0m: 2: 0x635c5cb53be5 - std::sys_common::backtrace::_print_fmt::h4feeb59774730d6b
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:68:5
�[1m�[90m[DEBUG]�[39m�[0m: 3: 0x635c5cb53be5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd736fd5964392270
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:44:22
�[1m�[90m[DEBUG]�[39m�[0m: 4: 0x635c5cb768bb - core::fmt::rt::Argument::fmt::h105051d8ea1ade1e
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/fmt/rt.rs:165:63
�[1m�[90m[DEBUG]�[39m�[0m: 5: 0x635c5cb768bb - core::fmt::write::hc6043626647b98ea
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/fmt/mod.rs:1168:21
�[1m�[90m[DEBUG]�[39m�[0m: 6: 0x635c5cb5080f - std::io::Write::write_fmt::h0d24b3e0473045db
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/io/mod.rs:1835:15
�[1m�[90m[DEBUG]�[39m�[0m: 7: 0x635c5cb539be - std::sys_common::backtrace::_print::h62df6fc36dcebfc8
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:47:5
�[1m�[90m[DEBUG]�[39m�[0m: 8: 0x635c5cb539be - std::sys_common::backtrace::print::h45eb8174d25a1e76
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:34:9
�[1m�[90m[DEBUG]�[39m�[0m: 9: 0x635c5cb54ef9 - std::panicking::default_hook::{{closure}}::haf3f0170eb4f3b53
�[1m�[90m[DEBUG]�[39m�[0m: 10: 0x635c5cb54c9a - std::panicking::default_hook::hb5d3b27aa9f6dcda
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:298:9
�[1m�[90m[DEBUG]�[39m�[0m: 11: 0x635c5cb553b3 - std::panicking::rust_panic_with_hook::h6b49d59f86ee588c
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:795:13
�[1m�[90m[DEBUG]�[39m�[0m: 12: 0x635c5cb55294 - std::panicking::begin_panic_handler::{{closure}}::hd4c2f7ed79b82b70
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:664:13
�[1m�[90m[DEBUG]�[39m�[0m: 13: 0x635c5cb540a9 - std::sys_common::backtrace::__rust_end_short_backtrace::h2946d6d32d7ea1ad
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:171:18
�[1m�[90m[DEBUG]�[39m�[0m: 14: 0x635c5cb54fc7 - rust_begin_unwind
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:652:5
�[1m�[90m[DEBUG]�[39m�[0m: 15: 0x635c5cb75aa3 - core::panicking::panic_fmt::ha02418e5cd774672
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/panicking.rs:72:14
�[1m�[90m[DEBUG]�[39m�[0m: 16: 0x635c5cb75eb6 - core::result::unwrap_failed::h55f86ada3ace5ed2
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/result.rs:1679:5
�[1m�[90m[DEBUG]�[39m�[0m: 17: 0x635c5cb0deb3 - core::result::Result<T,E>::expect::hb45caff1013f5be3
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/result.rs:1059:23
�[1m�[90m[DEBUG]�[39m�[0m: 18: 0x635c5caf516b - pyo3_build_config::impl_::search_lib_dir::h2194b2abd805d5df
�[1m�[90m[DEBUG]�[39m�[0m: at /home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-build-config-0.20.3/src/impl_.rs:1286:14
�[1m�[90m[DEBUG]�[39m�[0m: 19: 0x635c5caf4a0b - pyo3_build_config::impl_::find_all_sysconfigdata::heb6b42d5beec67c9
�[1m�[90m[DEBUG]�[39m�[0m: at /home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-build-config-0.20.3/src/impl_.rs:1242:9
�[1m�[90m[DEBUG]�[39m�[0m: 20: 0x635c5caf4207 - pyo3_build_config::impl_::find_sysconfigdata::hbd63581f7f8bdc74
�[1m�[90m[DEBUG]�[39m�[0m: at /home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-build-config-0.20.3/src/impl_.rs:1177:31
�[1m�[90m[DEBUG]�[39m�[0m: 21: 0x635c5caf69ea - pyo3_build_config::impl_::cross_compile_from_sysconfigdata::h2e969c3a289c78d7
�[1m�[90m[DEBUG]�[39m�[0m: at /home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-build-config-0.20.3/src/impl_.rs:1350:25
�[1m�[90m[DEBUG]�[39m�[0m: 22: 0x635c5caf7377 - pyo3_build_config::impl_::load_cross_compile_config::h6bcf33fc6e79b5fd
�[1m�[90m[DEBUG]�[39m�[0m: at /home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-build-config-0.20.3/src/impl_.rs:1476:34
�[1m�[90m[DEBUG]�[39m�[0m: 23: 0x635c5cafa115 - pyo3_build_config::impl_::make_cross_compile_config::h834f43a492bd85b6
�[1m�[90m[DEBUG]�[39m�[0m: at /home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-build-config-0.20.3/src/impl_.rs:1700:38
�[1m�[90m[DEBUG]�[39m�[0m: 24: 0x635c5cb0c23f - pyo3_build_config::pyo3_build_script_impl::resolve_interpreter_config::h6b2ff69f3e1b1b1f
�[1m�[90m[DEBUG]�[39m�[0m: at /home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-build-config-0.20.3/src/lib.rs:188:50
�[1m�[90m[DEBUG]�[39m�[0m: 25: 0x635c5cae93bf - build_script_build::configure_pyo3::h4037781168eaf882
�[1m�[90m[DEBUG]�[39m�[0m: at /home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-ffi-0.20.3/build.rs:138:30
�[1m�[90m[DEBUG]�[39m�[0m: 26: 0x635c5cae9c91 - build_script_build::main::h9a1fdd38e81b0092
�[1m�[90m[DEBUG]�[39m�[0m: at /home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-ffi-0.20.3/build.rs:179:21
�[1m�[90m[DEBUG]�[39m�[0m: 27: 0x635c5cae72fb - core::ops::function::FnOnce::call_once::hd05877634f2684c1
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/ops/function.rs:250:5
�[1m�[90m[DEBUG]�[39m�[0m: 28: 0x635c5cae71ce - std::sys_common::backtrace::__rust_begin_short_backtrace::hc7cd0b9891824d89
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:155:18
�[1m�[90m[DEBUG]�[39m�[0m: 29: 0x635c5cae7241 - std::rt::lang_start::{{closure}}::h739fa09c273b8fb1
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/rt.rs:159:18
�[1m�[90m[DEBUG]�[39m�[0m: 30: 0x635c5cb4c00d - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hf57beef1b8c334ce
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/ops/function.rs:284:13
�[1m�[90m[DEBUG]�[39m�[0m: 31: 0x635c5cb4c00d - std::panicking::try::do_call::h65791b6ab5d9b39f
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:559:40
�[1m�[90m[DEBUG]�[39m�[0m: 32: 0x635c5cb4c00d - std::panicking::try::h5a3dd25e8a379a23
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:523:19
�[1m�[90m[DEBUG]�[39m�[0m: 33: 0x635c5cb4c00d - std::panic::catch_unwind::he2ce8403bab77de2
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panic.rs:149:14
�[1m�[90m[DEBUG]�[39m�[0m: 34: 0x635c5cb4c00d - std::rt::lang_start_internal::{{closure}}::h0b55d0da19178545
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/rt.rs:141:48
�[1m�[90m[DEBUG]�[39m�[0m: 35: 0x635c5cb4c00d - std::panicking::try::do_call::h33cbeb674c7644e0
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:559:40
�[1m�[90m[DEBUG]�[39m�[0m: 36: 0x635c5cb4c00d - std::panicking::try::h530c58b4c9daadba
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:523:19
�[1m�[90m[DEBUG]�[39m�[0m: 37: 0x635c5cb4c00d - std::panic::catch_unwind::h92e02677901e11e4
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panic.rs:149:14
�[1m�[90m[DEBUG]�[39m�[0m: 38: 0x635c5cb4c00d - std::rt::lang_start_internal::hcee5ed89fc25829a
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/rt.rs:141:20
�[1m�[90m[DEBUG]�[39m�[0m: 39: 0x635c5cae721a - std::rt::lang_start::hab66e5ff8333bf1a
�[1m�[90m[DEBUG]�[39m�[0m: at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/rt.rs:158:17
�[1m�[90m[DEBUG]�[39m�[0m: 40: 0x635c5cae9e7e - main
�[1m�[90m[DEBUG]�[39m�[0m: 41: 0x7cb1e9629d90 - __libc_start_call_main
�[1m�[90m[DEBUG]�[39m�[0m: at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
�[1m�[90m[DEBUG]�[39m�[0m: 42: 0x7cb1e9629e40 - __libc_start_main_impl
�[1m�[90m[DEBUG]�[39m�[0m: at ./csu/../csu/libc-start.c:392:3
�[1m�[90m[DEBUG]�[39m�[0m: 43: 0x635c5cae5e55 - _start
�[1m�[90m[DEBUG]�[39m�[0m: 44: 0x0 - <unknown>
�[1m�[90m[DEBUG]�[39m�[0m: warning: build failed, waiting for other jobs to finish...
I'm wondering if I'm going in the right direction and why it's impossible to build pyo3-ffi v0.20.3
?
That said, I was able to create a .whl for tiktoken, but I was not able to install it with pip, apparently because pip install inside buildozer has a different architecture than android. There is also a .so file, but I don't understand what to do with it next
Please help me figure this out. Rust speeds up Python code, and we are ignoring it.
I hope this helps! Feel free to adjust any details as necessary.
@RobertFlatt there's actually cryptography
@sensoryfox you can read more there to see how you can go about it.
I'm trying, but currently, I'm stuck due to the incompatibility of supertools
.
When attempting to assemble a wheel from
�[1m[INFO]�[0m: �[36m-> directory context /home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/tiktoken/armeabi-v7a__ndk_target_21/tiktoken�[39m
�[1m�[90m[DEBUG]�[39m�[0m: �[90m->�[0m running python3 -m build --wheel --config-setting builddir=/home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/tiktoken/armeabi-v7a__ndk_target_21/tiktoken/p4a_android_build�[0m
�[1m�[90m[DEBUG]�[39m�[0m: �[1m* Creating isolated environment: venv+pip...�[0m
�[1m�[90m[DEBUG]�[39m�[0m: �[1m* Installing packages in isolated environment:�[0m
�[1m�[90m[DEBUG]�[39m�[0m: - setuptools-rust>=1.5.2
�[1m�[90m[DEBUG]�[39m�[0m: - setuptools>=62.4
�[1m�[90m[DEBUG]�[39m�[0m: - wheel
Here is the error:
�[1m�[90m[DEBUG]�[39m�[0m: pkg_resources.VersionConflict: (setuptools 51.3.3 (/home/fox/GPT_bot/SensoryContextAndroid/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages), Requirement.parse('setuptools>=62.4'))
And here is my current recipe:
from pythonforandroid.recipe import RustCompiledComponentsRecipe
from os.path import join
import sh
from pythonforandroid.toolchain import current_directory, shprint
class TiktokenRecipe(RustCompiledComponentsRecipe):
name = 'tiktoken'
version = '0.7.0'
url = 'https://github.com/openai/tiktoken/archive/refs/tags/{version}.tar.gz'
# Dependencies
depends = ['setuptools>=62.4', 'setuptools-rust>=1.5.2', 'wheel', 'rust', 'regex>=2022.1.18', 'requests>=2.26.0']
def get_recipe_env(self, arch, **kwargs):
env = super().get_recipe_env(arch, **kwargs)
# Update environment variables for building Rust components
build_target = self.RUST_ARCH_CODES[arch.arch].upper().replace("-", "_")
env["CARGO_BUILD_TARGET"] = build_target
shprint(sh.pip, 'install', 'setuptools>=62.4', _env=env)
shprint(sh.pip, 'install', 'setuptools-rust>=1.5.2', _env=env)
shprint(sh.pip, 'install', 'wheel', _env=env)
return env
def prebuild_arch(self, arch):
super().prebuild_arch(arch)
# Additional steps before building, if necessary
def build_arch(self, arch):
super().build_arch(arch)
env = self.get_recipe_env(arch)
with current_directory(self.get_build_dir(arch.arch)):
# Install dependencies before building
# Build
shprint(sh.python, 'setup.py', 'install', _env=env)
def postbuild_arch(self, arch):
super().postbuild_arch(arch)
# Additional steps after building, if necessary
recipe = TiktokenRecipe()
A pre-solution has been found:
Tiktoken has been successfully built, and there are no errors at runtime. I am currently dealing with other dependency issues related to openai.
Here is my recipe:
from pythonforandroid.recipe import RustCompiledComponentsRecipe
from os.path import join
import sh
from pythonforandroid.toolchain import current_directory, shprint
from os.path import join, exists
from os import makedirs
class TiktokenRecipe(RustCompiledComponentsRecipe):
name = 'tiktoken'
version = '0.7.0'
url = 'https://github.com/openai/tiktoken/archive/refs/tags/{version}.tar.gz'
# Dependencies
depends = ['setuptools>=62.4', 'setuptools-rust>=1.5.2', 'wheel', 'rust', 'regex>=2022.1.18', 'requests>=2.26.0']
def get_recipe_env(self, arch):
env = super().get_recipe_env(arch)
env['CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER'] = join(self.ctx.ndk_dir, 'toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang')
return env
def build_arch(self, arch):
env = self.get_recipe_env(arch)
build_dir = self.get_build_dir(arch.arch)
with current_directory(build_dir):
shprint(sh.cargo, 'build', '--release', _env=env)
# Check several possible paths and filenames
so_file = join(build_dir, 'target', 'aarch64-linux-android', 'release', 'libtiktoken.so')
if not exists(so_file):
so_file = join(build_dir, 'target', 'aarch64-linux-android', 'release', 'lib_tiktoken.so')
if not exists(so_file):
so_file = join(build_dir, 'target', 'armv7-linux-androideabi', 'release', 'libtiktoken.so')
if not exists(so_file):
so_file = join(build_dir, 'target', 'armv7-linux-androideabi', 'release', 'lib_tiktoken.so')
if not exists(so_file):
raise FileNotFoundError(f"Compiled shared object file not found: {so_file}")
# Get the exact path to the Python install directory
site_packages_dir = self.ctx.get_python_install_dir(arch)
target_dir = join(site_packages_dir, 'tiktoken')
if not exists(target_dir):
makedirs(target_dir)
shprint(sh.cp, so_file, join(target_dir, '_tiktoken.so'))
recipe = TiktokenRecipe()
And my Cargo.toml
:
#!/bin/bash
# Check architecture
case "$ARCH" in
arm64-v8a)
HOSTPLATFORM="aarch64-linux-android"
;;
armeabi-v7a)
HOSTPLATFORM="armv7-linux-androideabi"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
# Set environment variables
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android${ANDROID_API}-clang"
export CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER="${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi${ANDROID_API}-clang"
# Copy tiktoken sources to the build directory
cp -r "${RECIPE_DIR}/tiktoken" "${BUILD_DIR}/tiktoken"
cd "${BUILD_DIR}/tiktoken"
# Update dependencies
export CARGO_HOME="${BUILD_DIR}/.cargo"
${CARGO_HOME}/bin/cargo update
# Build the library
${CARGO_HOME}/bin/cargo ndk -t ${HOSTPLATFORM} --lib build --release
# Copy the built library
cp target/${HOSTPLATFORM}/release/_tiktoken.so "${PYTHON_INSTALL_DIR}/lib/${PLAT_TRIPLET}/site-packages/tiktoken/_tiktoken.so"
In the recipe, pay close attention to the API version. I needed version 24.
@sensoryfox EDIT I forgot internet permission, now fixed.
Proof of concept, as follows, builds and runs.
Please consider submitting a working recipe as a PR (and close this issue).
-
curl https://sh.rustup.rs -sSf | sh
Open new shell -
Edit buildozer.spec, default except:
requirements = python3,kivy,tiktoken
android.permissions = android.permission.INTERNET
p4a.branch = develop
p4a.local_recipes = ./p4a-recipes
- Create ./p4a-recipes/tiktoken/__init__.py
Containing:
from pythonforandroid.recipe import RustCompiledComponentsRecipe
class TiktokenRecipe(RustCompiledComponentsRecipe):
name = 'tiktoken'
version = '0.7.0'
url = 'https://github.com/openai/tiktoken/archive/refs/tags/{version}.tar.gz'
depends = ['regex','requests']
recipe = TiktokenRecipe()
- test case:
from kivy.app import App
from kivy.uix.label import Label
import tiktoken
class Hello(App):
def build(self):
enc = tiktoken.get_encoding("o200k_base")
return Label(text =enc.decode(enc.encode("Hello world !")))
Hello().run()
Yes, that's it! It installs without any problems! Thanks, but doing PR is a big responsibility, thanks for the suggestion.
THANK YOU SO MUCH!
READY TO MAKE PR BUT DON'T KNOW HOW
I'm having a different problem building Numpy-Meson and can't figure out what the cause is yet(
logs:
�[1m�[90m[DEBUG]�[39m�[0m: NumPy 1.26.5
�[1m�[90m[DEBUG]�[39m�[0m:
�[1m�[90m[DEBUG]�[39m�[0m: User defined options
�[1m�[90m[DEBUG]�[39m�[0m: Cross files : /tmp/android.meson.cross
�[1m�[90m[DEBUG]�[39m�[0m: Native files: /home/fox/GPT_bot/SensoryApp_final/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/numpy/armeabi-v7a__ndk_target_24/numpy/p4a_android_build/meson-python-native-file.ini
�[1m�[90m[DEBUG]�[39m�[0m: buildtype : release
�[1m�[90m[DEBUG]�[39m�[0m: b_ndebug : if-release
�[1m�[90m[DEBUG]�[39m�[0m: b_vscrt : md
�[1m�[90m[DEBUG]�[39m�[0m: blas : none
�[1m�[90m[DEBUG]�[39m�[0m: lapack : none
�[1m�[90m[DEBUG]�[39m�[0m:
�[1m�[90m[DEBUG]�[39m�[0m: Found ninja-1.11.1.git.kitware.jobserver-1 at /home/fox/GPT_bot/SensoryApp_final/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages/bin/ninja
�[1m�[90m[DEBUG]�[39m�[0m: Cleaning... 0 files.
�[1m�[90m[DEBUG]�[39m�[0m: �[36m�[1m+ /home/fox/GPT_bot/SensoryApp_final/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages/bin/ninja�[0m
�[1m�[90m[DEBUG]�[39m�[0m: [1/374] Generating 'numpy/core/libnpymath.a.p/ieee754.c'
�[1m�[90m[DEBUG]�[39m�[0m: Ignoring "sys._home = value" override
�[1m�[90m[DEBUG]�[39m�[0m: [2/374] Generating 'numpy/core/_multiarray_tests.cpython-311-x86_64-linux-gnu.so.p/templ_common.h'
�[1m�[90m[DEBUG]�[39m�[0m: Ignoring "sys._home = value" override
�[1m�[90m[DEBUG]�[39m�[0m: [3/374] Generating numpy/core/npy_math_internal.h with a custom command
�[1m�[90m[DEBUG]�[39m�[0m: Ignoring "sys._home = value" override
�[1m�[90m[DEBUG]�[39m�[0m: [4/374] Generating 'numpy/core/_multiarray_tests.cpython-311-x86_64-linux-gnu.so.p/_multiarray_tests.c'
�[1m�[90m[DEBUG]�[39m�[0m: Ignoring "sys._home = value" override
�[1m�[90m[DEBUG]�[39m�[0m: [5/374] Generating numpy/core/_umath_doc_generated with a custom command
�[1m�[90m[DEBUG]�[39m�[0m: [6/374] Generating 'numpy/core/libnpymath.a.p/npy_math_complex.c'
�[1m�[90m[DEBUG]�[39m�[0m: Ignoring "sys._home = value" override
�[1m�[90m[DEBUG]�[39m�[0m: [7/374] Generating 'numpy/core/libargfunc.dispatch.h_baseline.a.p/arraytypes.h'
�[1m�[90m[DEBUG]�[39m�[0m: Ignoring "sys._home = value" override
�[1m�[90m[DEBUG]�[39m�[0m: [8/374] Generating numpy/generate-version with a custom command
�[1m�[90m[DEBUG]�[39m�[0m: Saving version to numpy/version.py
�[1m�[90m[DEBUG]�[39m�[0m: [9/374] Generating 'numpy/core/_umath_tests.cpython-311-x86_64-linux-gnu.so.p/_umath_tests.c'
�[1m�[90m[DEBUG]�[39m�[0m: Ignoring "sys._home = value" override
�[1m�[90m[DEBUG]�[39m�[0m: [10/374] Generating numpy/core/__umath_generated with a custom command
�[1m�[90m[DEBUG]�[39m�[0m: [11/374] Generating 'numpy/core/libargfunc.dispatch.h_baseline.a.p/npy_sort.h'
�[1m�[90m[DEBUG]�[39m�[0m: Ignoring "sys._home = value" override
�[1m�[90m[DEBUG]�[39m�[0m: [12/374] Generating numpy/__init__.py with a custom command
�[1m�[90m[DEBUG]�[39m�[0m: Ignoring "sys._home = value" override
�[1m�[90m[DEBUG]�[39m�[0m: [13/374] Generating numpy/__init__.cython-30.pxd with a custom command
�[1m�[90m[DEBUG]�[39m�[0m: Ignoring "sys._home = value" override
�[1m�[90m[DEBUG]�[39m�[0m: [14/374] Compiling C object numpy/core/libnpymath.a.p/meson-generated_ieee754.c.o
�[1m�[90m[DEBUG]�[39m�[0m: FAILED: numpy/core/libnpymath.a.p/meson-generated_ieee754.c.o
�[1m�[90m[DEBUG]�[39m�[0m: /home/fox/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang -Inumpy/core/libnpymath.a.p -Inumpy/core -I../numpy/core -Inumpy/core/include -I../numpy/core/include -I../numpy/core/src/npymath -I../numpy/core/src/common -I/usr/local/include/python3.11 -I/home/fox/GPT_bot/SensoryApp_final/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Include -I/home/fox/GPT_bot/SensoryApp_final/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3-libbz2-liblzma/armeabi-v7a__ndk_target_24/python3/android-build -I/home/fox/GPT_bot/SensoryApp_final/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_24/python3/Include -I/home/fox/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/home/fox/GPT_bot/SensoryApp_final/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/myapp/armeabi-v7a/include/python3.1 -I/home/fox/GPT_bot/SensoryApp_final/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/numpy/armeabi-v7a__ndk_target_24/numpy/p4a_android_build/meson_cpu -fcolor-diagnostics -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -O3 -fno-strict-aliasing -ftrapping-math -Wno-unsupported-floating-point-opt -target armv7a-linux-androideabi24 -fomit-frame-pointer -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -DANDROID -fPIC -MD -MQ numpy/core/libnpymath.a.p/meson-generated_ieee754.c.o -MF numpy/core/libnpymath.a.p/meson-generated_ieee754.c.o.d -o numpy/core/libnpymath.a.p/meson-generated_ieee754.c.o -c numpy/core/libnpymath.a.p/ieee754.c
�[1m�[90m[DEBUG]�[39m�[0m: In file included from ../numpy/core/src/npymath/ieee754.c.src:7:
�[1m�[90m[DEBUG]�[39m�[0m: In file included from ../numpy/core/src/npymath/npy_math_common.h:4:
�[1m�[90m[DEBUG]�[39m�[0m: In file included from /usr/local/include/python3.11/Python.h:38:
�[1m�[90m[DEBUG]�[39m�[0m: /usr/local/include/python3.11/pyport.h:601:2: error: "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
�[1m�[90m[DEBUG]�[39m�[0m: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
This problem was encountered earlier in the comments:
https://community.ibm.com/community/user/power/discussion/python-3117-long-bit-issue-building-numpy-126
I'd be glad if you could help
@sensoryfox
The short answer is I have no idea. I have contributed occasionally but I'm not a current user, just driving by, and got sucked in because I was interested to learn about rust in p4a.
Here is what I can see, the numpy recipe has been completely rewritten in the develop version of p4a
Develop https://github.com/kivy/python-for-android/blob/develop/pythonforandroid/recipes/numpy/__init__.py
Release https://github.com/kivy/python-for-android/blob/release-2024.01.21/pythonforandroid/recipes/numpy/__init__.py
You must use the develop version because that is the only one with Rust support,
So while I know the previous numpy was solid, I know nothing about the develop version. Generally we should not expect that develop is totally stable, and specifically support for Meson introduces two new classes.
I tried
requirements = python3,kivy,tiktoken,numpy
android.minapi = 24
And the build failed with
[DEBUG]: < File "/home/bobf/ex/hello/.buildozer/android/platform/build-
[DEBUG]: arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/Lib/random.py",
[DEBUG]: line 49, in <module>
[DEBUG]: < from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as
[DEBUG]: _ceil
[DEBUG]: < ModuleNotFoundError: No module named 'math'
Which makes no sense to me.
Looking at the changelog 87a32be the author is T-Dynamos
I suggest you create a new issue about the Meson numpy recipe, and tag the author, hopefully they can help. It is very important to create a SMALL example for somebody to replicate. Note that I can't replicate what you see, I see what is presumably some other issue,
@RobertFlatt You need to install patchelf
on your system to fix it. This is not yet updated in documentation.
87a32be#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557
@T-Dynamos Brilliant that fixed it. Thanks for answering before I got around to asking. 😀
cc : @sensoryfox
Thanks @RobertFlatt, @T-Dynamos! It turned out that Numpy is successfully installed on arm64-v8a, but the error occurs when working with armeabi-v7a platform.
Everything is fine under arm64-v8a and I went to build the project further
@sensoryfox
Starting with my example above #3050 (comment)
pip install patchelf
Change requirement to requirements = python3, kivy, tiktoken, numpy
Add android.minapi = 24
It builds. I'm outta here 🤣