The fierce battle with OpenCV and Buildozer, I really need help

711 views
Skip to first unread message

dnobze...@gmail.com

unread,
Mar 28, 2019, 8:18:50 AM3/28/19
to Kivy users support
Good day. Which day I've been trying to build an .APK file from python3, kivy and OpenCV. Finally, when the assembly was already over, I got an error:
 
  File "/usr/local/lib/python3.6/dist-packages/sh.py", line 3226, in __getitem__     raise CommandNotFound (k) sh.CommandNotFound: cmakeapi = 28

Attach buildozer.spec + full log(pastebin or txt file)

https://pastebin.com/uAjrFMwd (log with error)


Python 3.6.7
kivy 1.10.1
OpenCV 4.0.1

ndk = 15b
sdk = 28
api = 28

Please tell me what to do.

[INFO]: Building opencv for armeabi-v7a
[INFO]: -> running mkdir -p /home/max/desktop/ass...(and 104 more)
[INFO]: -> directory context /home/max/desktop/asshole/.buildozer/android/platform/build/build/other_builds/opencv/armeabi-v7a__ndk_target_21/opencv/build
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/max/desktop/python-for-android-master/pythonforandroid/toolchain.py", line 1081, in <module>
 main
()
 
File "/home/max/desktop/python-for-android-master/pythonforandroid/toolchain.py", line 1075, in main
 
ToolchainCL()
 
File "/home/max/desktop/python-for-android-master/pythonforandroid/toolchain.py", line 577, in __init__
 getattr
(self, args.subparser_name.replace('-', '_'))(args)
 
File "/home/max/desktop/python-for-android-master/pythonforandroid/toolchain.py", line 151, in wrapper_func
 build_dist_from_args
(ctx, dist, args)
 
File "/home/max/desktop/python-for-android-master/pythonforandroid/toolchain.py", line 200, in build_dist_from_args
 build_recipes
(build_order, python_modules, ctx)
 
File "/home/max/desktop/python-for-android-master/pythonforandroid/build.py", line 562, in build_recipes
 recipe
.build_arch(arch)
 
File "/home/max/desktop/python-for-android-master/pythonforandroid/recipes/opencv/__init__.py", line 66, in build_arch
 shprint
(sh.cmake,
 
File "/usr/local/lib/python3.6/dist-packages/sh.py", line 3349, in __getattr__
 
return self.__env[name]
 
File "/usr/local/lib/python3.6/dist-packages/sh.py", line 3226, in __getitem__
 
raise CommandNotFound(k)
sh
.CommandNotFound: cmake
# Command failed: /usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=camcamcamcam --bootstrap=sdl2 --requirements=python3,kivy,numpy,opencv==master --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/max/desktop/asshole/.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.spec
error log.txt

Robert Flatt

unread,
Mar 28, 2019, 9:29:00 PM3/28/19
to Kivy users support
sh.CommandNotFound: cmake

Is cmake installed?

Your friend Google will help understand how to do this on your OS.

Максим Шепард

unread,
Mar 28, 2019, 10:46:19 PM3/28/19
to Kivy users support
HI!
I installed cmake and everything went smoothly until a new bug came out at the very end of the build. I believe that it is due to the outdated version of Python 3.6.7. I installed the latest version of Python 3.7.3, tell me what to do to make these commands run on 3.7.3

Compiling '/home/max/desktop/asshole/.buildozer/android/app/venv/lib64/python3.6/site-packages/pip-10.0.1-py3.6.egg/pip/_vendor/webencodings/x_user_defined.py'...
WARNING
: Received a --sdk argument, but this argument is deprecated and does nothing.
No compiled python is present to zip, skipping.
Error while running "/home/max/desktop/asshole/.buildozer/android/platform/build/build/other_builds/hostpython3/desktop/hostpython3/native-build/python -OO -m compileall -b -f /home/max/desktop/asshole/.buildozer/android/app"
This probably means one of your Python files has a syntax error, see logs above


Attached a log with an error in txt

пятница, 29 марта 2019 г., 6:29:00 UTC+5 пользователь Robert Flatt написал:
error log(2).txt

Robert Flatt

unread,
Mar 29, 2019, 1:34:22 AM3/29/19
to Kivy users support
No idea

This probably means one of your Python files has a syntax error, see logs above

I cant see an error "above" Is this the full log file ?

Does the app run (under Python) on your desktop?

I don't think the issue is the Python minor version, because p4a (inside Buildozer) downloads its own copy of Python, so it knows it has the version it is happy with.

Максим Шепард

unread,
Mar 29, 2019, 1:39:36 AM3/29/19
to Kivy users support
I corrected the error. In pycharm, I created a new project with the python 3.7 interpreter, clicked checkbox to inherit libraries, and moved the .py and buildozer.spec file to a new project. APK assembled without errors.

Robert Flatt

unread,
Mar 29, 2019, 2:23:16 AM3/29/19
to Kivy users support
Excellent work :)

elhossiny ibrahim

unread,
Dec 25, 2019, 7:34:19 AM12/25/19
to Kivy users support

void biov

unread,
Dec 25, 2019, 8:09:47 AM12/25/19
to kivy-...@googlegroups.com
Install cmake. At least that's what I saw in the errors. 

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/fef619b9-cb79-4853-9a5a-d6c0cee61a64%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages