我已经尝试过使用kivy并尝试即时测试此代码以使其正常工作
import kivy
from kivy.app import App
from kivy.uix.label import Label
class Test(App):
def Build(self):
return Label(text='This is code')
if __name__ == "__main__":
Test().run()
我得到这些错误:
[CRITICAL] [Text ] Unable to find any valuable Text provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes
sdl2 - ImportError: DLL load failed: The specified module could not be found.
File "C:\Users\Thism\Documents\Coding\Python\Projects\venv\lib\site-packages\kivy\core\__init__.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
File "C:\Users\Thism\Documents\Coding\Python\Projects\venv\lib\site-packages\kivy\core\text\text_sdl2.py", line 13, in <module>
from kivy.core.text._text_sdl2 import (_SurfaceContainer, _get_extents,
pil - ModuleNotFoundError: No module named 'PIL'
File "C:\Users\Thism\Documents\Coding\Python\Projects\venv\lib\site-packages\kivy\core\__init__.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
File "C:\Users\Thism\Documents\Coding\Python\Projects\venv\lib\site-packages\kivy\core\text\text_pil.py", line 7, in <module>
from PIL import Image, ImageFont, ImageDraw
[CRITICAL] [App ] Unable to get a Text provider, abort.
我发现其他人有此问题,试图重新安装枕头和其他依赖项,例如 pip install kivy.deps.glew或pip install kivy.deps.angle 但是他们还没有工作,有人可以帮忙吗?谢谢。 :)