Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Setuptools issue building numpy

Open
#3,121 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
32/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
android, numpy, python

Research direction

Reproduce with buildozer android debug using the shown requirements and Android settings, then focus on the numpy build step and its isolated environment where setuptools.build_meta cannot be imported. Compare the installed build dependencies and the hostpython3 invocation; done means the same configuration completes the numpy wheel build.

Written by the indexing model from the issue text.

Description

recipe
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.

Dominant language
Python
Stars
8.9k
Forks
2k
Avg merge
12h 20m
Merged PRs (30d)
9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from kivy/python-for-android

All issues in kivy/python-for-android

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.