Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need solve problem while run buildozer android debug (Cython Installation error) #2458

Open
mo7amedk opened this issue Jul 21, 2024 · 4 comments

Comments

@mo7amedk
Copy link

mo7amedk commented Jul 21, 2024

STDERR:


# Command failed: ['/mnt/c/Users/m/Documents/rak/myenv/bin/python3', '-m', 'pythonforandroid.toolchain', 'create', '--dist_name=myapp', '--bootstrap=sdl2', '--requirements=python3,kivy,_ctypes', '--arch=arm64-v8a', '--arch=armeabi-v7a', '--copy-libs', '--color=always', '--storage-dir=/mnt/c/Users/m/Documents/rak/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a', '--ndk-api=21', '--ignore-setup-py', '--debug']
# ENVIRONMENT:
#     SHELL = '/bin/bash'
#     WSL_DISTRO_NAME = 'Ubuntu'
#     NAME = 'DESKTOP-7686VAS'
#     PWD = '/mnt/c/Users/m/Documents/rak'
#     LOGNAME = 'm'
#     HOME = '/home/m'
#     LANG = 'C.UTF-8'
#     WSL_INTEROP = '/run/WSL/17_interop'
#     LS_COLORS = 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:'
#     VIRTUAL_ENV = '/mnt/c/Users/m/Documents/rak/myenv'
#     LESSCLOSE = '/usr/bin/lesspipe %s %s'
#     TERM = 'xterm-256color'
#     LESSOPEN = '| /usr/bin/lesspipe %s'
#     USER = 'm'
#     SHLVL = '1'
#     VIRTUAL_ENV_PROMPT = '(myenv) '
#     PS1 = ('(myenv) \\[\\e]0;\\u@\\h: '
 '\\w\\a\\]${debian_chroot:+($debian_chroot)}\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ ')
#     WSLENV = ''
#     XDG_DATA_DIRS = '/usr/local/share:/usr/share:/var/lib/snapd/desktop'
#     PATH = ('/home/m/.buildozer/android/platform/apache-ant-1.9.4/bin:/mnt/c/Users/m/Documents/rak/myenv/bin:/home/m/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program '
 'Files/WindowsApps/CanonicalGroupLimited.Ubuntu_2204.3.49.0_x64__79rhkp1fndgsc:/mnt/c/Program '
 'Files/Common '
 'Files/Oracle/Java/javapath:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Users/Administrator/AppData/Local/Programs/Python/Python312:/mnt/c/Users/Administrator/AppData/Local/Programs/Python/Python312/Scripts:/mnt/c/Users/Administrator/AppData/Local/Android/Sdk/ndk/27.0.12077973:/mnt/c/Users/Administrator/AppData/Local/Android/Sdk/platform-tools:/mnt/c/Program '
 'Files/Java/jdk-22/bin:/mnt/c/Users/Administrator/AppData/Local/Android/Sdk/build-tools/35.0.0:/mnt/c/Users/Administrator/AppData/Local/Android/Sdk/cmdline-tools/latest/bin:/mnt/c/Users/m/AppData/Local/Programs/Python/Python312/Scripts/:/mnt/c/Users/m/AppData/Local/Programs/Python/Python312/:/mnt/c/Users/m/AppData/Local/Microsoft/WindowsApps:/snap/bin')
#     HOSTTYPE = 'x86_64'
#     OLDPWD = '/home/m'
#     _ = '/mnt/c/Users/m/Documents/rak/myenv/bin/buildozer'
#     PACKAGES_PATH = '/home/m/.buildozer/android/packages'
#     ANDROIDSDK = '/home/m/.buildozer/android/platform/android-sdk'
#     ANDROIDNDK = '/home/m/.buildozer/android/platform/android-ndk-r25b'
#     ANDROIDAPI = '31'
#     ANDROIDMINAPI = '21'
#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

edit by @neutrinoceros : formatting

@neutrinoceros
Copy link
Contributor

@mo7amedk There isn't enough information here. In fact I don't see h5py mentioned anywhere in the report you posted so could you clarify how this relates to this code base ?

@mo7amedk
Copy link
Author

i have problen in install _ctypes

@tacaswell
Copy link
Member

tacaswell commented Jul 22, 2024

I have a theory of what is going on here. _ctypes is part of the standard library and may not be included in all builds of CPython (that ctypes in optional is mild speculations). We do not use ctypes in the main library, but we do use it in setup_configure.py to sort out if we can find an installed version of libhdf5 and extract the version number from it.

I suspect that

h5py/setup_configure.py

Lines 83 to 115 in 44ba349

def from_env(cls):
mpi = mpi_enabled()
h5_inc, h5_lib, h5_macros = cls._find_hdf5_compiler_settings(mpi)
h5_version_s = os.environ.get('HDF5_VERSION')
h5py_ros3 = os.environ.get('H5PY_ROS3')
h5py_direct_vfd = os.environ.get('H5PY_DIRECT_VFD')
if h5_version_s and not mpi and h5py_ros3 and h5py_direct_vfd:
# if we know config, don't use wrapper, it may not be supported
return cls(
h5_inc, h5_lib, h5_macros, validate_version(h5_version_s), mpi,
h5py_ros3 == '1', h5py_direct_vfd == '1')
h5_wrapper = HDF5LibWrapper(h5_lib)
if h5_version_s:
h5_version = validate_version(h5_version_s)
else:
h5_version = h5_wrapper.autodetect_version()
if mpi and not h5_wrapper.has_mpi_support():
raise RuntimeError("MPI support not detected")
if h5py_ros3:
ros3 = h5py_ros3 == '1'
else:
ros3 = h5_wrapper.has_ros3_support()
if h5py_direct_vfd:
direct_vfd = h5py_direct_vfd == '1'
else:
direct_vfd = h5_wrapper.has_direct_vfd_support()
return cls(h5_inc, h5_lib, h5_macros, h5_version, mpi, ros3, direct_vfd)
needs to be cleaned up a bit more to :

  • fail with a better error message telling the user which ENVS to set to avoid trying to extract info from libhdf5 via ctypes
  • actually support the non-sniffing case where we do not want ros3 or vfd support.

@tacaswell
Copy link
Member

On re-reading, I missread h5py_ros3 == '1' as h5py_ros3 = '1', 🤦🏻 🐑 .

I think that setting the ENVs HDF5_VERSION=X.Y.Z (set to the actual version you have), 'H5PY_ROS3=0, H5PY_DIRECT_VFD=0 before invoking the build system.

If that works, then I think the only thing we need to do is to say that as an error message if ctypes fails to import.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants