kivymd 应用程序在 Android 手机上崩溃 ModuleNotFoundError: No module named 'PIL' [英] kivymd app crashes on android phone ModuleNotFoundError: No module named 'PIL'

查看:21
本文介绍了kivymd 应用程序在 Android 手机上崩溃 ModuleNotFoundError: No module named 'PIL'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Kivy 应用在 Android 手机上启动时崩溃.buildozer logcat 显示如下错误:

My Kivy app crashes on launch on android phone. buildozer logcat shows the following error:

02-21 17:09:58.777 14941 14979 I python  :  ModuleNotFoundError: No module named 'PIL'
02-21 17:09:58.777 14941 14979 I python  : Python for android ended.

这是我的 buildozer.spec 要求:

Here are my buildozer.spec requirements:

requirements = python3,kivy==2.0.0,git+https://github.com/HeaTTheatR/KivyMD.git,sdl2_ttf==2.0.15,python-dateutil,requests,urllib3,chardet,idna,plyer,android,jnius,oscpy

据我了解,只有 KivyMD 依赖于 PIL.该应用程序在我的 Mac 上完美运行,并且之前在 android 手机上运行过.错误刚刚开始发生.所以,我真的很困惑,希望能得到任何帮助.提前致谢!

As I understand, only the KivyMD depends on PIL. The app works perfectly on my mac and WAS working before on the android phone. The error just started to occur. So, I'm really confused and would appreciate any help. Thanks in advance!

推荐答案

您可能已经知道,KivyMD 依赖于 PIL,而不是 Kivy.您在应用程序中使用最新版本的 KivyMD,这取决于 PIL.要消除错误,只需在 buildozer.spec 文件的 requirements 中添加 pillow.

As you might already know, KivyMD depends on PIL, not Kivy. You are using the latest version of KivyMD using git in your app, which depends on PIL. To remove the error just add pillow in the requirements of your buildozer.spec file.

这篇关于kivymd 应用程序在 Android 手机上崩溃 ModuleNotFoundError: No module named 'PIL'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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