kivymd app crashes on android phone ModuleNotFoundError: No module named #39;PIL#39;(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'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:kivymd 应用程序在 Android 手机上崩溃 ModuleNotFoundError: No module named 'PIL'


- android 4中的android RadioButton问题 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01