gpt4 book ai didi

python - 我怎样才能从我的kivy程序中删除 "sdl2 - ImportError"和 "pil - ModuleNotFoundError"

转载 作者:太空宇宙 更新时间:2023-11-03 20:56:31 25 4
gpt4 key购买 nike

我是 kivy 新手,想要运行我的第一个程序,但我得到了

sdl2 - ImportError: DLL load failed " and "pil - ModuleNotFoundError: No module named 'PIL'

我应该怎样做才能消除错误?

我尝试安装所有:

python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew

python -m pip install kivy.deps.sdl2

但似乎没有什么可以解决我的问题。

这是我尝试过的代码:

import kivy
from kivy.app import App
from kivy.uix.label import Label

class Myapp(App):
def build(self):
return Label(text="Abhay 's APP")

if __name__ == "__main__":
Myapp().run()

我得到的输出:

[INFO   ] [Logger      ] Record log in C:\Users\SONY VAIO\.kivy\logs\kivy_19-05-05_44.txt
[INFO ] [Kivy ] v1.10.1
[INFO ] [Python ] v3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)]
[INFO ] [Factory ] 194 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_gif (img_sdl2, img_pil, img_ffpyplayer ignored)
[CRITICAL] [Text ] Unable to find any valuable Text provider.
sdl2 - ImportError: DLL load failed: The specified module could not be found.
File "C:\Users\SONY VAIO\AppData\Local\Programs\Python\Python37-32\lib\site-packages\kivy\core\__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "C:\Users\SONY VAIO\AppData\Local\Programs\Python\Python37-32\lib\site-packages\kivy\core\text\text_sdl2.py", line 12, in <module>
from kivy.core.text._text_sdl2 import (_SurfaceContainer, _get_extents,

pil - ModuleNotFoundError: No module named 'PIL'
File "C:\Users\SONY VAIO\AppData\Local\Programs\Python\Python37-32\lib\site-packages\kivy\core\__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "C:\Users\SONY VAIO\AppData\Local\Programs\Python\Python37-32\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.

最佳答案

使用pycharm时,需要安装pycharm环境中的所有依赖。

关于python - 我怎样才能从我的kivy程序中删除 "sdl2 - ImportError"和 "pil - ModuleNotFoundError",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55989757/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com