問題描述
我的 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'的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!