如何在 Kivy Launcher 中运行 OpenCV?

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

问题描述

我正在构建一个需要 OpenCV 模块的 Kivy 应用程序,但是 Kivy 启动器在我运行它时不断崩溃.

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

我已经从 PyPi (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) 并放置它进入我的 kivy 项目目录

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模块提供python-for-android 项目.

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

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

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)