Repository navigation
Closed
Description
Getting ERROR Backend 'setuptools.build_meta' for cryptography package 42.0.1
STDERR:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/runner/work/app/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1246, in <module>
main()
File "/home/runner/work/app/.buildozer/android/platform/python-for-android/pythonforandroid/entrypoints.py", line 18, in main
ToolchainCL()
File "/home/runner/work/app/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 677, in __init__
getattr(self, command)(args)
File "/home/runner/work/app/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 104, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/home/runner/work/app/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 163, in build_dist_from_args
build_recipes(build_order, python_modules, ctx,
File "/home/runner/work/app/.buildozer/android/platform/python-for-android/pythonforandroid/build.py", line 504, in build_recipes
recipe.build_arch(arch)
File "/home/runner/work/app/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1452, in build_arch
super().build_arch(arch)
File "/home/runner/work/app/.buildozer/android/platform/python-for-android/pythonforandroid/recipe.py", line 1289, in build_arch
shprint(
File "/home/runner/work/app/.buildozer/android/platform/python-for-android/pythonforandroid/logger.py", line 167, in shprint
for line in output:
File "/home/runner/.local/lib/python3.11/site-packages/sh.py", line 879, in __next__
self.wait()
File "/home/runner/.local/lib/python3.11/site-packages/sh.py", line 796, in wait
self.handle_command_exit_code(exit_code)
File "/home/runner/.local/lib/python3.11/site-packages/sh.py", line 823, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /home/runner/work/app/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64- v8a__ndk_target_24/python3/android-build/python3 -m build --wheel --config-setting builddir=/home/runner/work/app/.buildozer/android/platform/build-arm64-v8a/build/other_builds/cryptography/arm64-v8a__ndk_target_24/cryptography/p4a_android_build
STDOUT:
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
- cffi>=1.12; platform_python_implementation != 'PyPy'
- setuptools-rust>=1.7.0
- setuptools>=61.0.0
- wheel
* Getting build dependencies for wheel...
Ignoring "sys._home = value" override
Traceback (most recent call last):
File "/home/runner/work/app/.buildozer/android/platform/build-arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native- build/Lib/site-packages/pyproject_hooks/_impl.py", line 402, in _call_hook
raise BackendUnavailable(
pyproject_hooks._impl.BackendUnavailable: Cannot import 'setuptools.build_meta'
ERROR Backend 'setuptools.build_meta' is not available.
Cause: p4a's hostpython has a patched sys._home that breaks virtual environment creation. When python -m build creates an isolated venv to build cryptography, the hostpython's embedded sys._home override prevents setuptools.build_meta from being importable in that venv (hence the "Ignoring sys._home = value" override message).
Pinning cryptography to an older version alone won't fix this — the p4a recipe uses python -m build --wheel for ALL versions, which always creates the broken isolated venv.
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]import error 'setuptools.build_meta'[/-][+]import error 'setuptools.build_meta' cryptography[/+]T-Dynamos commentedon May 16, 2026
@CluckyMedia Are you on latest p4a?
This error was recently fixed, is caused by build package not accepting custom
PYTHONPATH.CluckyMedia commentedon May 16, 2026
I have pinned to commit 5aa9732 in my buildozer since late last year, had been working fine until a recent build attempt.
T-Dynamos commentedon May 16, 2026
Yes this is expected, you can modify and specify
build==1.4.2in recipe.py for a fix if you want to use same commit.CluckyMedia commentedon May 16, 2026
"Yes this is expected, you can modify and specify build==1.4.2 in recipe.py for a fix if you want to use same commit." - sorry how do I do that??
T-Dynamos commentedon May 16, 2026
@CluckyMedia Are you unwilling to use the latest commit?
Issue you are facing is caused by the recipe.py always using
build's latest version, so after1.4.2this broke and was fixed recently in p4a.CluckyMedia commentedon May 16, 2026
I will pin to HEAD and see if all good. Thanks
CluckyMedia commentedon May 16, 2026
At what point did python version change to 3.14?
T-Dynamos commentedon May 16, 2026
A while back? You can use 3.11 by pinning it.
CluckyMedia commentedon May 18, 2026
I pinned to 3.11.9 but still having issues with cryptography and the latest develop of p4a.
_rust.abi3.so extension module for the cryptography package is trying to reference the internal CPython symbol _Py_NoneStruct. While standard ABI3 (stable ABI) wheels should not depend on internal C-API symbols like _Py_NoneStruct, this error indicates that the .so file was either compiled incorrectly without the proper ABI3 restrictions, or it was built against a different Python version/ABI than the 3.11 runtime being used by the app.
T-Dynamos commentedon May 18, 2026
Duplicate #3329