I build APK by Buildozer, but got error. It says that Cython not installed. But it is not true. I have tied Cython 0.21(dev) and 0.24. Error still appears.
@sergen-pc:~/PythonExp/kivy_exp/TextUni$ buildozer android_new debug
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Debian 'dpkg' package management program version 1.18.4 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
# Search for Git (git)
# -> found at /usr/bin/git
# Search for Cython (cython)
# -> found at /usr/bin/cython
# Search for Java compiler (javac)
# -> found at /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
# -> found at /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/keytool
# Install platform
# Apache ANT found at /home/sergen/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/sergen/android-studio/sdk
# Android NDK found at /home/sergen/android-ndk-r11c
# Check application requirements
# Check garden requirements
# Compile platform
# Run 'python -m pythonforandroid.toolchain --color=always --storage-dir=/home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build create --dist_name=unic --bootstrap=sdl2 --requirements=kivy,hostpython2,cython --arch armeabi-v7a --copy-libs'
# Cwd /home/sergen/python-for-android-master
[INFO]: This python-for-android revamp is an experimental alpha release!
[INFO]: It should work (mostly), but you may experience missing features or bugs.
[INFO]: Will compile for the following archs: armeabi-v7a
[INFO]: Found Android API target in $ANDROIDAPI
[INFO]: Available Android APIs are (17, 19, 21, 23)
[INFO]: Requested API target 17 is available, continuing.
[INFO]: Found NDK dir in $ANDROIDNDK
[INFO]: Got NDK version from $ANDROIDNDKVER
[INFO]: Using Google NDK r11
[INFO]: Found virtualenv at /usr/local/bin/virtualenv
[INFO]: ccache is missing, the build will not be optimized in the future.
[INFO]: Found the following toolchain versions: ['4.9']
[INFO]: Picking the latest gcc toolchain, here 4.9
[INFO]: No existing dists meet the given requirements!
[INFO]: No dist exists that meets your requirements, so one will be built.
[INFO]: Bootstrap requires recipes ['sdl2', ('python2', 'python3crystax')]
[INFO]: No recipe named cython; will attempt to install with pip
[INFO]: Loaded recipe sdl2 (depends on [('python2', 'python3crystax'), 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf'], conflicts ['sdl', 'pygame', 'pygame_bootstrap_components'])
[INFO]: Loaded recipe hostpython2 (depends on [], conflicts ['hostpython3'])
[INFO]: Loaded recipe kivy (depends on ['pyjnius', ('sdl2', 'pygame'), ('python2', 'python3crystax')])
[INFO]: Loaded recipe sdl2_image (depends on [])
[INFO]: Loaded recipe sdl2_mixer (depends on [])
[INFO]: Loaded recipe sdl2_ttf (depends on [])
[INFO]: Loaded recipe pyjnius (depends on ['six', ('python2', 'python3crystax'), ('sdl2', 'sdl', 'webviewjni')])
[INFO]: Loaded recipe six (depends on [('python2', 'python3crystax')])
[INFO]: Found multiple valid recipe sets:
[INFO]: ['six', 'sdl2', u'kivy', 'sdl2_ttf', u'hostpython2', 'sdl2_mixer', 'sdl2_image', 'pyjnius', 'python2']
[INFO]: ['sdl2', 'six', 'sdl2_ttf', u'hostpython2', 'python3crystax', 'sdl2_mixer', 'sdl2_image', 'pyjnius', u'kivy']
[INFO]: Using the first of these: ['six', 'sdl2', u'kivy', 'sdl2_ttf', u'hostpython2', 'sdl2_mixer', 'sdl2_image', 'pyjnius', 'python2']
[INFO]: The selected bootstrap is sdl2
[INFO]: # Creating dist with sdl2 bootstrap
[INFO]: Dist will have name unic and recipes (kivy, hostpython2, cython)
[INFO]: -> running cp -r /home/sergen/python-for-...(and 163 more)
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Recipe build order is [u'hostpython2', 'python2', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'sdl2', 'six', 'pyjnius', u'kivy']
[INFO]: The requirements (cython) were not found as recipes, they will be installed with pip.
[INFO]: # Downloading recipes
[INFO]: Downloading hostpython2
[INFO]: -> running mkdir -p /home/sergen/PythonEx...(and 73 more)
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/packages/hostpython2
[INFO]: -> running basename http://python.org/ftp/...(and 33 more)
[INFO]: hostpython2 download already cached, skipping
[WARNING]: Should check headers here! Skipping for now.
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Downloading python2
[INFO]: -> running mkdir -p /home/sergen/PythonEx...(and 69 more)
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/packages/python2
[INFO]: -> running basename http://python.org/ftp/...(and 33 more)
[INFO]: python2 download already cached, skipping
[WARNING]: Should check headers here! Skipping for now.
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Downloading sdl2_image
[INFO]: -> running mkdir -p /home/sergen/PythonEx...(and 72 more)
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/packages/sdl2_image
[INFO]: -> running basename https://www.libsdl.or...(and 52 more)
[INFO]: sdl2_image download already cached, skipping
[WARNING]: Should check headers here! Skipping for now.
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Downloading sdl2_mixer
[INFO]: -> running mkdir -p /home/sergen/PythonEx...(and 72 more)
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/packages/sdl2_mixer
[INFO]: -> running basename https://www.libsdl.or...(and 52 more)
[INFO]: sdl2_mixer download already cached, skipping
[WARNING]: Should check headers here! Skipping for now.
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Downloading sdl2_ttf
[INFO]: -> running mkdir -p /home/sergen/PythonEx...(and 70 more)
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/packages/sdl2_ttf
[INFO]: -> running basename https://www.libsdl.org...(and 48 more)
[INFO]: sdl2_ttf download already cached, skipping
[WARNING]: Should check headers here! Skipping for now.
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Downloading sdl2
[INFO]: -> running mkdir -p /home/sergen/PythonEx...(and 66 more)
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/packages/sdl2
[INFO]: -> running basename https://www.libsdl.org...(and 26 more)
[INFO]: sdl2 download already cached, skipping
[WARNING]: Should check headers here! Skipping for now.
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Downloading six
[INFO]: -> running mkdir -p /home/sergen/PythonEx...(and 65 more)
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/packages/six
[INFO]: -> running basename https://pypi.python.or...(and 40 more)
[INFO]: six download already cached, skipping
[WARNING]: Should check headers here! Skipping for now.
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Downloading pyjnius
[INFO]: -> running mkdir -p /home/sergen/PythonEx...(and 69 more)
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/packages/pyjnius
[INFO]: -> running basename https://github.com/kiv...(and 28 more)
[INFO]: pyjnius download already cached, skipping
[WARNING]: Should check headers here! Skipping for now.
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Downloading kivy
[INFO]: -> running mkdir -p /home/sergen/PythonEx...(and 66 more)
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/packages/kivy
[INFO]: -> running basename https://github.com/kiv...(and 25 more)
[INFO]: kivy download already cached, skipping
[WARNING]: Should check headers here! Skipping for now.
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: # Building all recipes for arch armeabi-v7a
[INFO]: # Unpacking recipes
[INFO]: Unpacking hostpython2 for armeabi-v7a
[INFO]: -> running basename http://python.org/ftp/...(and 33 more)
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop
[INFO]: hostpython2 is already unpacked, skipping
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Unpacking python2 for armeabi-v7a
[INFO]: -> running basename http://python.org/ftp/...(and 33 more)
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/other_builds/python2/armeabi-v7a
[INFO]: python2 is already unpacked, skipping
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Unpacking sdl2_image for armeabi-v7a
[INFO]: -> running basename https://www.libsdl.or...(and 52 more)
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2/jni
[INFO]: sdl2_image is already unpacked, skipping
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Unpacking sdl2_mixer for armeabi-v7a
[INFO]: -> running basename https://www.libsdl.or...(and 52 more)
work[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2/jni
[INFO]: sdl2_mixer is already unpacked, skipping
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Unpacking sdl2_ttf for armeabi-v7a
[INFO]: -> running basename https://www.libsdl.org...(and 48 more)
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2/jni
[INFO]: sdl2_ttf is already unpacked, skipping
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Unpacking sdl2 for armeabi-v7a
[INFO]: -> running basename https://www.libsdl.org...(and 26 more)
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2/jni
[INFO]: sdl2 is already unpacked, skipping
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Unpacking six for armeabi-v7a
[INFO]: -> running basename https://pypi.python.or...(and 40 more)
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/other_builds/six-python2/armeabi-v7a
[INFO]: six is already unpacked, skipping
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Unpacking pyjnius for armeabi-v7a
[INFO]: -> running basename https://github.com/kiv...(and 28 more)
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/other_builds/pyjnius-python2-sdl2/armeabi-v7a
[INFO]: pyjnius is already unpacked, skipping
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Unpacking kivy for armeabi-v7a
[INFO]: -> running basename https://github.com/kiv...(and 25 more)
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/other_builds/kivy-python2-sdl2/armeabi-v7a
[INFO]: kivy is already unpacked, skipping
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: # Prebuilding recipes
[INFO]: Prebuilding hostpython2 for armeabi-v7a
[INFO]: -> running cp /home/sergen/python-for-and...(and 193 more)
[INFO]: Prebuilding python2 for armeabi-v7a
[INFO]: python2 has no prebuild_armeabi_v7a, skipping
[INFO]: Applying patches for python2[armeabi-v7a]
[INFO]: python2 already patched, skipping
[INFO]: Prebuilding sdl2_image for armeabi-v7a
[INFO]: sdl2_image has no prebuild_armeabi_v7a, skipping
[INFO]: Applying patches for sdl2_image[armeabi-v7a]
[INFO]: sdl2_image already patched, skipping
[INFO]: Prebuilding sdl2_mixer for armeabi-v7a
[INFO]: sdl2_mixer has no prebuild_armeabi_v7a, skipping
[INFO]: Applying patches for sdl2_mixer[armeabi-v7a]
[INFO]: sdl2_mixer already patched, skipping
[INFO]: Prebuilding sdl2_ttf for armeabi-v7a
[INFO]: sdl2_ttf has no prebuild_armeabi_v7a, skipping
[INFO]: Prebuilding sdl2 for armeabi-v7a
[INFO]: sdl2 has no prebuild_armeabi_v7a, skipping
[INFO]: Applying patches for sdl2[armeabi-v7a]
[INFO]: sdl2 already patched, skipping
[INFO]: Prebuilding six for armeabi-v7a
[INFO]: six has no prebuild_armeabi_v7a, skipping
[INFO]: Prebuilding pyjnius for armeabi-v7a
[INFO]: pyjnius has no prebuild_armeabi_v7a, skipping
[INFO]: Applying patches for pyjnius[armeabi-v7a]
[INFO]: pyjnius already patched, skipping
[INFO]: Prebuilding kivy for armeabi-v7a
[INFO]: kivy has no prebuild_armeabi_v7a, skipping
[INFO]: # Building recipes
[INFO]: Building hostpython2 for armeabi-v7a
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2
[INFO]: hostpython already exists, skipping build
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Building python2 for armeabi-v7a
[INFO]: Copying hostpython binary to targetpython folder
[INFO]: -> running cp /home/sergen/PythonExp/kivy...(and 225 more)
[INFO]: Building sdl2_image for armeabi-v7a
[INFO]: Building sdl2_mixer for armeabi-v7a
[INFO]: Building sdl2_ttf for armeabi-v7a
[INFO]: Building sdl2 for armeabi-v7a
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/bootstrap_builds/sdl2-python2/jni
[INFO]: -> running ndk-build V=1
('path is', '/home/sergen/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86/bin/:/home/sergen/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/:/home/sergen/android-ndk-r11c:/home/sergen/android-studio/sdk/tools:/home/sergen/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/sergen/.pythonbrew/bin:/home/sergen/.pythonbrew/bin::/home/sergen/SDK_Android/tools:/home/sergen/SDK_Android/platform-tools:/usr/bin:/bin:/usr/local/bin:/home/sergen/android-ndk-r11c:/home/sergen/android-ndk-r9c:/home/sergen/android-ndk-r9d')
[INFO]: <- directory context /home/sergen/python-for-android-master
[INFO]: Building six for armeabi-v7a
[INFO]: Python package already exists in site-packages
[INFO]: six said it is already built, skipping
[INFO]: Building pyjnius for armeabi-v7a
[INFO]: jnius apparently isn't already in site-packages
[INFO]: Cythonizing anything necessary in pyjnius
[INFO]: -> directory context /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/other_builds/pyjnius-python2-sdl2/armeabi-v7a/pyjnius
[INFO]: -> running python.host -c import sys; print(sys.path)
('name is', None, <class 'pythonforandroid.recipes.six.SixRecipe'>)
('name is', 'jnius', <class 'pythonforandroid.recipes.pyjnius.PyjniusRecipe'>)
('path is', '/home/sergen/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86/bin/:/home/sergen/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/:/home/sergen/android-ndk-r11c:/home/sergen/android-studio/sdk/tools:/home/sergen/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/sergen/.pythonbrew/bin:/home/sergen/.pythonbrew/bin::/home/sergen/SDK_Android/tools:/home/sergen/SDK_Android/platform-tools:/usr/bin:/bin:/usr/local/bin:/home/sergen/android-ndk-r11c:/home/sergen/android-ndk-r9c:/home/sergen/android-ndk-r9d')
[INFO]: Trying first build of pyjnius to get cython files: this is expected to fail
[INFO]: -> running python.host setup.py build_ext -v
('cwd is', '/home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/other_builds/pyjnius-python2-sdl2/armeabi-v7a/pyjnius')
[INFO]: pyjnius first build failed (as expected)
[INFO]: Running cython where appropriate
[INFO]: Cythonize jnius/jnius.pyx
[INFO]: -> running cython ./jnius/jnius.pyx
()
[INFO]: -> running python.host setup.py build_ext -v
[INFO]: STDOUT:
/home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/python-installs/unic/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running build_ext
failed to import Cython: /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/python-installs/unic/lib/python2.7/lib-dynload/_io.so: wrong ELF class: ELFCLASS32
error: Cython does not appear to be installed
[INFO]: STDERR:
[INFO]: COMMAND:
cd /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/other_builds/pyjnius-python2-sdl2/armeabi-v7a/pyjnius && /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/python-installs/unic/bin/python.host setup.py build_ext -v
[WARNING]: ERROR: /home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build/build/python-installs/unic/bin/python.host failed!
# Command failed: python -m pythonforandroid.toolchain --color=always --storage-dir=/home/sergen/PythonExp/kivy_exp/TextUni/.buildozer/android/platform/build create --dist_name=unic --bootstrap=sdl2 --requirements=kivy,hostpython2,cython --arch armeabi-v7a --copy-libs
#
# 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
How did you install Cython? Make sure it's a system-wide installation, not in a virtualenv.
From the error, is the problem actually that it's using the targetpython environment, not the system one (although I don't know why it would be)?
How did you install Cython? Make sure it's a system-wide installation, not in a virtualenv.
Download pack from cython.org . Then execute ' sudo python setup.py install '.
From the error, is the problem actually that it's using the targetpython environment, not the system one (although I don't know why it would be)?
Maybe it is my fault. I will try to fix it.
From the error, is the problem actually that it's using the targetpython environment, not the system one (although I don't know why it would be)?
What part of the error-log tells about it ?
SOLVED.
Cython, kivy, buildozer, python-for-android removed and reinstalled.
'sudo pip uninstall cython'
'sudo apt-get remove cython'
'sudo apt-get remove buildozer'
'sudo pip uninstall python-for-android'
Install cython:
'sudo apt-get install cython'
Install kivy-1.8 stable from package downloaded from git
Install python-for-android old-toolchain from package downloaded from git
@nesergen perfect works thank you so much
Most helpful comment
SOLVED.
Cython, kivy, buildozer, python-for-android removed and reinstalled.
'sudo pip uninstall cython'
'sudo apt-get remove cython'
'sudo apt-get remove buildozer'
'sudo pip uninstall python-for-android'
Install cython:
'sudo apt-get install cython'
Install kivy-1.8 stable from package downloaded from git
Install python-for-android old-toolchain from package downloaded from git