在Ubuntu 18.04中运行buildozer时出错

时间:2019-12-21 05:13:53

标签: python python-3.x kivy ubuntu-18.04

在Ubuntu 18.04上运行buildozer时出现各种错误。我试图用Kivy创建一个应用程序,但是,当我运行buildozer init命令时,它会运行并下载所有依赖项模块,最后,它给了我这个错误。有人可以帮我解决从此开始的错误。谢谢。

[INFO]:    -> running ndk-build V=1
[INFO]:    <- directory context /home/bhavin/apptest/.buildozer/android/platform/python-for-android
[INFO]:    Building setuptools for armeabi-v7a
[INFO]:    setuptools apparently isn't already in site-packages
[INFO]:    Installing setuptools into site-packages
[INFO]:    -> directory context 
/home/bhavin/apptest/.buildozer/android/platform/build/build/other_builds/setuptools- 
python3/armeabi-v7a__ndk_target_21/setuptools
[INFO]:    -> running python setup.py install -O2 --...(and 107 more)
Exception in thread background thread for pid 24611:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/home/bhavin/buildozer-env/lib/python3.6/site-packages/sh.py", line 1540, in wrap
fn(*args, **kwargs)
File "/home/bhavin/buildozer-env/lib/python3.6/site-packages/sh.py", line 2459, in background_thread
handle_exit_code(exit_code)
File "/home/bhavin/buildozer-env/lib/python3.6/site-packages/sh.py", line 2157, in fn
return self.command.handle_command_exit_code(exit_code)
File "/home/bhavin/buildozer-env/lib/python3.6/site-packages/sh.py", line 815, in 
handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:

RAN: /home/bhavin/apptest/.buildozer/android/platform/build/build/other_builds/
hostpython3/desktop/hostpython3/native-build/python setup.py install -O2 -- 
root=/home/bhavin/apptest/.buildozer/android/platform/build/build/python-installs/bhavinapp -- 
install-lib=.

STDOUT:
Traceback (most recent call last):
File "setup.py", line 11, in <module>
import setuptools
File "/home/bhavin/apptest/.buildozer/android/platform/build/build/other_builds/setuptools- 
python3/armeabi-v7a__ndk_target_21/setuptools/setuptools/__init__.py", line 20, in <module>
from setuptools.dist import Distribution, Feature
File "/home/bhavin/apptest/.buildozer/android/platform/build/build/other_builds/setuptools- 
python3/armeabi-v7a__ndk_target_21/setuptools/setuptools/dist.py", line 36, in <module>
from setuptools import windows_support
File "/home/bhavin/apptest/.buildozer/android/platform/build/build/other_builds/setuptools- 
python3/armeabi-v7a__ndk_target_21/setuptools/setuptools/windows_support.py", line 2, in <module>
import ctypes
File "/home/bhavin/apptest/.buildozer/android/platform/build/build/other_builds/
/hostpython3/desktop/hostpython3/Lib/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'

STDERR:

Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/bhavin/apptest/.buildozer/android/platform/python-for- 
android/pythonforandroid/toolchain.py", line 1192, in <module>
main()
File "/home/bhavin/apptest/.buildozer/android/platform/python-for- 
android/pythonforandroid/entrypoints.py", line 18, in main
ToolchainCL()
File "/home/bhavin/apptest/.buildozer/android/platform/python-for- 
android/pythonforandroid/toolchain.py", line 668, in __init__
getattr(self, args.subparser_name.replace('-', '_'))(args)
File "/home/bhavin/apptest/.buildozer/android/platform/python-for- 
android/pythonforandroid/toolchain.py", line 153, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/home/bhavin/apptest/.buildozer/android/platform/python-for- 
android/pythonforandroid/toolchain.py", line 206, in build_dist_from_args
args, "ignore_setup_py", False
File "/home/bhavin/apptest/.buildozer/android/platform/python-for- 
android/pythonforandroid/build.py", line 577, in build_recipes
recipe.build_arch(arch)
File "/home/bhavin/apptest/.buildozer/android/platform/python-for- 
android/pythonforandroid/recipe.py", line 844, in build_arch
self.install_python_package(arch)
File "/home/bhavin/apptest/.buildozer/android/platform/python-for- 
android/pythonforandroid/recipe.py", line 863, in install_python_package
_env=hpenv, *self.setup_extra_args)
File "/home/bhavin/apptest/.buildozer/android/platform/python-for- 
android/pythonforandroid/logger.py", line 180, in shprint
for line in output:
File "/home/bhavin/buildozer-env/lib/python3.6/site-packages/sh.py", line 863, in next
self.wait()
File "/home/bhavin/buildozer-env/lib/python3.6/site-packages/sh.py", line 792, in wait
self.handle_command_exit_code(exit_code)
File "/home/bhavin/buildozer-env/lib/python3.6/site-packages/sh.py", line 815, in 
handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:

RAN: /home/bhavin/apptest/.buildozer/android/platform/build/build/other_builds/
hostpython3/desktop/hostpython3/native-build/python setup.py install -O2 -- 
root=/home/bhavin/apptest/.buildozer/android/platform/build/build/python-installs/bhavinapp -- 
install-lib=.

STDOUT:

Traceback (most recent call last):
File "setup.py", line 11, in <module>
import setuptools
File "/home/bhavin/apptest/.buildozer/android/platform/build/build/other_builds/setuptools- 
python3/armeabi-v7a__ndk_target_21/setuptools/setuptools/__init__.py", line 20, in <module>
from setuptools.dist import Distribution, Feature
File "/home/bhavin/apptest/.buildozer/android/platform/build/build/other_builds/setuptools- 
python3/armeabi-v7a__ndk_target_21/setuptools/setuptools/dist.py", line 36, in <module>
from setuptools import windows_support
File "/home/bhavin/apptest/.buildozer/android/platform/build/build/other_builds/setuptools- 
python3/armeabi-v7a__ndk_target_21/setuptools/setuptools/windows_support.py", line 2, in <module>
import ctypes
File "/home/bhavin/apptest/.buildozer/android/platform/build/build/other_builds/hostpython3/
desktop/hostpython3/Lib/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'

STDERR:

# Command failed: /home/bhavin/buildozer-env/bin/python3 -m pythonforandroid.toolchain create -- 
dist_name=bhavinapp --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs -- 
color=always --storage-dir="/home/bhavin/apptest/.buildozer/android/platform/build" --ndk-api=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
(buildozer-env) bhavin@bhavin-VirtualBox:~/apptest$

1 个答案:

答案 0 :(得分:0)

安装libffi标头(可能是一个名为libffi-dev的软件包),然后删除应用程序目录中的.buildozer文件,然后再次运行buildozer。