如何在Kivy Launcher中运行OpenCV? [英] How to run OpenCV in Kivy Launcher?

查看:384
本文介绍了如何在Kivy Launcher中运行OpenCV?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建需要OpenCV模块的Kivy应用程序,但是运行Kivy Launcher时,它总是崩溃.

I am building a Kivy app that requires the OpenCV module, but the Kivy Launcher keeps crashing when I run it.

我已经从PyPi下载了OpenCV( https://pypi.python.org/pypi/opencv-python#downloads ),并将其放入我的kivy项目目录中.我的项目目录当前包含main.py文件,android.txt文件和opencv下载.在main.py文件中,我在代码顶部编写了"import cv2".但是,我的应用程序在Kivy启动器中不断崩溃.

I have downloaded OpenCV from PyPi (https://pypi.python.org/pypi/opencv-python#downloads) and placed it into my kivy project directory. My project directory currently contains the main.py file, the android.txt file, and the opencv download. In the main.py file I write "import cv2" at the top of the code. However, my app keeps crashing in the Kivy launcher.

安装在Kivy Launcher中使用的python扩展的正确方法是什么?

What is the correct way to install python extensions for use in Kivy Launcher?

顺便说一句-我是Kivy和Android应用程序开发的新手,因此非常感谢您提供帮助

BTW- I am brand new to Kivy and Android app development, so any help is much appreciated

推荐答案

我已经从PyPi下载了OpenCV ( https://pypi.python.org/pypi/opencv-python#downloads)并将其放置 进入我的基维项目目录

I have downloaded OpenCV from PyPi (https://pypi.python.org/pypi/opencv-python#downloads) and placed it into my kivy project directory

这不是工作方式. OpenCV应该专门针对Android进行编译.我猜您使用 buildozer 来构建apk吗?在这种情况下,您应该修改buildozer.spec文件中的requirements行以添加opencv,例如:

This is not how things work. OpenCV should be compiled specifically for Android. I guess you use buildozer to build apk? In this case you should modify requirements line inside buildozer.spec file to add opencv, for example:

requirements =  kivy, opencv

为Android 提供 python-for-android项目.

Compiling python modules for Android provided by python-for-android project.

这篇关于如何在Kivy Launcher中运行OpenCV?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆