<bdo id='NThY8'></bdo><ul id='NThY8'></ul>
  • <small id='NThY8'></small><noframes id='NThY8'>

    <i id='NThY8'><tr id='NThY8'><dt id='NThY8'><q id='NThY8'><span id='NThY8'><b id='NThY8'><form id='NThY8'><ins id='NThY8'></ins><ul id='NThY8'></ul><sub id='NThY8'></sub></form><legend id='NThY8'></legend><bdo id='NThY8'><pre id='NThY8'><center id='NThY8'></center></pre></bdo></b><th id='NThY8'></th></span></q></dt></tr></i><div id='NThY8'><tfoot id='NThY8'></tfoot><dl id='NThY8'><fieldset id='NThY8'></fieldset></dl></div>
    <legend id='NThY8'><style id='NThY8'><dir id='NThY8'><q id='NThY8'></q></dir></style></legend>

      1. <tfoot id='NThY8'></tfoot>
      2. 导入外部库时 Kivy 在启动时崩溃

        时间:2023-09-01
          <tbody id='HciDK'></tbody>

        • <bdo id='HciDK'></bdo><ul id='HciDK'></ul>

          <small id='HciDK'></small><noframes id='HciDK'>

          <legend id='HciDK'><style id='HciDK'><dir id='HciDK'><q id='HciDK'></q></dir></style></legend>

              <i id='HciDK'><tr id='HciDK'><dt id='HciDK'><q id='HciDK'><span id='HciDK'><b id='HciDK'><form id='HciDK'><ins id='HciDK'></ins><ul id='HciDK'></ul><sub id='HciDK'></sub></form><legend id='HciDK'></legend><bdo id='HciDK'><pre id='HciDK'><center id='HciDK'></center></pre></bdo></b><th id='HciDK'></th></span></q></dt></tr></i><div id='HciDK'><tfoot id='HciDK'></tfoot><dl id='HciDK'><fieldset id='HciDK'></fieldset></dl></div>
                <tfoot id='HciDK'></tfoot>

                1. 本文介绍了导入外部库时 Kivy 在启动时崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我使用 Kivy Launcher 运行了一个基本的Hello World".程序,它运行良好,但是当我在开始时添加 import cv2 时,应用程序在启动后立即崩溃.

                  I used the Kivy Launcher to run a basic "Hello World" program and it worked fine, but when I added in an import cv2 at the beginning, the app crashes immediately after launching.

                  主.py:Main.py 代码

                  Android.txt:Android.txt 图片

                  Android.txt: Image of Android.txt

                  谢谢!

                  推荐答案

                  kivy启动器用于严格运行Kivy模块和Python预装模块.所以在这种情况下,由于 cv2 没有预装在正常的 python 安装中,kivy 启动器无法识别它,然后得到一个ModuleNotFoundError: No Module named cv2"错误,这会导致它崩溃.因此,如果您尝试导入预装 python 的模块以外的模块,则必须使用 Buildozer 编译成 .apk 文件才能在 android 上运行它

                  The kivy launcher is used to run strictly Kivy modules and Python preinstalled modules. So in this case, since cv2 doesn't come preinstalled in normal python installations, kivy launcher doesn't recognise it and then gets a "ModuleNotFoundError: No Module named cv2" error, which causes it to crash. So, if you're trying to import modules aside from those which come preinstalled with python you'd have to compile into a .apk file using Buildozer to run it on an android

                  这篇关于导入外部库时 Kivy 在启动时崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在带有 buildozer 的 android 上使用 python3 下一篇:KivyMD,在 android 中看不到图标,但在 linux 上工作

                  相关文章

                  最新文章

                  1. <tfoot id='ZvuQM'></tfoot>

                      • <bdo id='ZvuQM'></bdo><ul id='ZvuQM'></ul>
                      <legend id='ZvuQM'><style id='ZvuQM'><dir id='ZvuQM'><q id='ZvuQM'></q></dir></style></legend>

                      <small id='ZvuQM'></small><noframes id='ZvuQM'>

                      <i id='ZvuQM'><tr id='ZvuQM'><dt id='ZvuQM'><q id='ZvuQM'><span id='ZvuQM'><b id='ZvuQM'><form id='ZvuQM'><ins id='ZvuQM'></ins><ul id='ZvuQM'></ul><sub id='ZvuQM'></sub></form><legend id='ZvuQM'></legend><bdo id='ZvuQM'><pre id='ZvuQM'><center id='ZvuQM'></center></pre></bdo></b><th id='ZvuQM'></th></span></q></dt></tr></i><div id='ZvuQM'><tfoot id='ZvuQM'></tfoot><dl id='ZvuQM'><fieldset id='ZvuQM'></fieldset></dl></div>