kivy / kivy/python-for-android

Setuptools issue building numpy

Đang mở
#3,121 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
recipe
Ngôn ngữ chính
Python
Star
8.9k
Fork
2k
Merge trung bình
12 giờ 20 phút
Pull request đã merge (30 ngày)
9

Mô tả

```
Ubuntu 24.04
Python 3.12.3
```

```
requirements = python3,kivy,numpy
android.minapi = 24
android.ndk_api = 24
android.archs = arm64-v8a
p4a.branch = develop
```

```
(venv3) ~/ex/hello>pip list
Package Version
------------ -------
buildozer 1.5.0
Cython 3.0.12
distlib 0.3.9
filelock 3.17.0
pexpect 4.9.0
pip 25.0.1
platformdirs 4.3.6
ptyprocess 0.7.0
setuptools 75.8.2
sh 2.2.2
virtualenv 20.29.3
```
```
buildozer android debug
```

Starts well....

```
[INFO]: Building numpy for arm64-v8a
[INFO]: numpy apparently isn't already in site-packages
[INFO]: Writing cross file at: /tmp/android.meson.cross
[DEBUG]: -> running pip install build[virtualenv] pip Cython>=3.0.6 ninja==1.11.1.1 meson==1.4.0 --target /home/bobf/ex/hello/.buildozer/android/platform/build-arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages --python-version 3.11.5 --only-binary=:all: --upgrade
[DEBUG]: Collecting pip
[DEBUG]: Using cached pip-25.0.1-py3-none-any.whl.metadata (3.7 kB)
[DEBUG]: Collecting Cython>=3.0.6
[DEBUG]: Using cached Cython-3.0.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.3 kB)
[DEBUG]: Collecting ninja==1.11.1.1
[DEBUG]: Using cached ninja-1.11.1.1-py2.py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.whl.metadata (5.3 kB)
[DEBUG]: Collecting meson==1.4.0
[DEBUG]: Using cached meson-1.4.0-py3-none-any.whl.metadata (1.8 kB)
[DEBUG]: Collecting build[virtualenv]
[DEBUG]: Using cached build-1.2.2.post1-py3-none-any.whl.metadata (6.5 kB)
[DEBUG]: Collecting packaging>=19.1 (from build[virtualenv])
[DEBUG]: Using cached packaging-24.2-py3-none-any.whl.metadata (3.2 kB)
[DEBUG]: Collecting pyproject_hooks (from build[virtualenv])
[DEBUG]: Using cached pyproject_hooks-1.2.0-py3-none-any.whl.metadata (1.3 kB)
[DEBUG]: Collecting virtualenv>=20.0.35 (from build[virtualenv])
[DEBUG]: Using cached virtualenv-20.29.3-py3-none-any.whl.metadata (4.5 kB)
[DEBUG]: Collecting distlib<1,>=0.3.7 (from virtualenv>=20.0.35->build[virtualenv])
[DEBUG]: Using cached distlib-0.3.9-py2.py3-none-any.whl.metadata (5.2 kB)
[DEBUG]: Collecting filelock<4,>=3.12.2 (from virtualenv>=20.0.35->build[virtualenv])
[DEBUG]: Using cached filelock-3.17.0-py3-none-any.whl.metadata (2.9 kB)
[DEBUG]: Collecting platformdirs<5,>=3.9.1 (from virtualenv>=20.0.35->build[virtualenv])
[DEBUG]: Using cached platformdirs-4.3.6-py3-none-any.whl.metadata (11 kB)
[DEBUG]: Using cached ninja-1.11.1.1-py2.py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.whl (307 kB)
[DEBUG]: Using cached meson-1.4.0-py3-none-any.whl (935 kB)
[DEBUG]: Using cached pip-25.0.1-py3-none-any.whl (1.8 MB)
[DEBUG]: Using cached Cython-3.0.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB)
[DEBUG]: Using cached packaging-24.2-py3-none-any.whl (65 kB)
[DEBUG]: Using cached virtualenv-20.29.3-py3-none-any.whl (4.3 MB)
[DEBUG]: Using cached build-1.2.2.post1-py3-none-any.whl (22 kB)
[DEBUG]: Using cached pyproject_hooks-1.2.0-py3-none-any.whl (10 kB)
[DEBUG]: Using cached distlib-0.3.9-py2.py3-none-any.whl (468 kB)
[DEBUG]: Using cached filelock-3.17.0-py3-none-any.whl (16 kB)
[DEBUG]: Using cached platformdirs-4.3.6-py3-none-any.whl (18 kB)
[DEBUG]: Installing collected packages: ninja, distlib, pyproject_hooks, platformdirs, pip, packaging, meson, filelock, Cython, virtualenv, build
[DEBUG]: Successfully installed Cython-3.0.12 build-1.2.2.post1 distlib-0.3.9 filelock-3.17.0 meson-1.4.0 ninja-1.11.1.1 packaging-24.2 pip-25.0.1 platformdirs-4.3.6 pyproject_hooks-1.2.0 virtualenv-20.29.3
```

But fails with:

```
[INFO]: -> directory context /home/bobf/ex/hello/.buildozer/android/platform/build-arm64-v8a/build/other_builds/numpy/arm64-v8a__ndk_target_24/numpy
[DEBUG]: -> running python3 -m build --wheel --config-setting builddir=/home/bobf/ex/hello/.buildozer/android/platform/build-arm64-v8a/build/other_builds/numpy/arm64-v8a__ndk_target_24/numpy/p4a_android_build -Csetup-args=-Dblas=none -Csetup-args=-Dlapack=none -Csetup-args=--cross-file -Csetup-args=/tmp/android.meson.cross
[DEBUG]: * Creating isolated environment: venv+pip...
[DEBUG]: * Installing packages in isolated environment:
[DEBUG]: - Cython>=0.29.34,<3.1
[DEBUG]: - meson-python>=0.15.0,<0.16.0
[DEBUG]: * Getting build dependencies for wheel...
[DEBUG]: Ignoring "sys._home = value" override
[DEBUG]: * Installing packages in isolated environment:
[DEBUG]: - patchelf >= 0.11.0
[DEBUG]: > /home/bobf/ex/hello/.buildozer/android/platform/build-arm64-
[DEBUG]: v8a/build/other_builds/python3/arm64-v8a__ndk_target_24/python3/android-
[DEBUG]: build/python3 -m pip --python /tmp/build-env-cuoq9kcw/bin/python install
[DEBUG]: --use-pep517 --no-warn-script-location --no-compile -r /tmp/build-
[DEBUG]: reqs-f105xuxq.txt
[DEBUG]: < Collecting patchelf>=0.11.0 (from -r /tmp/build-reqs-f105xuxq.txt (line 1))
[DEBUG]: < Using cached patchelf-0.17.2.1.tar.gz (167 kB)
[DEBUG]: < Installing build dependencies: started
[DEBUG]: < Installing build dependencies: finished with status 'done'
[DEBUG]: < Getting requirements to build wheel: started
[DEBUG]: < Getting requirements to build wheel: finished with status 'done'
[DEBUG]: < Ignoring "sys._home = value" override
[DEBUG]: < ERROR: Exception:
[DEBUG]: < Traceback (most recent call last):
[DEBUG]: < File "/home/bobf/ex/hello/.buildozer/android/platform/build-
[DEBUG]: arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-
[DEBUG]: build/Lib/site-packages/pip/_internal/cli/base_command.py", line 106, in
[DEBUG]: _run_wrapper

(many lines deleted for brevity)

[DEBUG]: < File "/home/bobf/ex/hello/.buildozer/android/platform/build-
[DEBUG]: arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-
[DEBUG]: build/Lib/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 402, in
[DEBUG]: _call_hook
[DEBUG]: < raise BackendUnavailable(
[DEBUG]: < pip._vendor.pyproject_hooks._impl.BackendUnavailable: Cannot import
[DEBUG]: 'setuptools.build_meta'
[DEBUG]:
```

In addition to the user installed `setuptools==75.8.2`, the build did download `setuptools==69.2.0.` But I don't see any evidence of it in the "isolated environment", which of course doesn't mean it isn't there!

Google shows me this message occurs occasionally and in many contexts. Generally attributed to some unknown pip issue. I wondered if something was corrupted, so I created a new Ubuntu 22.04 instance, but this did not change the behavior.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Tái hiện bằng `buildozer android debug` với các requirements và thiết lập Android đã nêu, sau đó tập trung vào bước build numpy và môi trường cô lập của nó, nơi không thể import `setuptools.build_meta`. So sánh các dependency build đã cài đặt và lời gọi hostpython3; được xem là hoàn tất khi cùng cấu hình hoàn thành việc build wheel numpy.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
android, numpy, python
Lĩnh vực
build-system, mobile
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
32/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.