简体   繁体   English

如何修复 Kivy 问题 Sdl2 -import 错误? (已经尝试过pip'ing)

[英]How to Fix Kivy Issue Sdl2 -import Error? (Already tried pip'ing it)

This is my code which I copied stright from the kivy website to test the library.这是我从kivy website直接复制来测试库的代码。

from kivy.app import App
from kivy.uix.button import Button

class TestApp(App):
    def build(self):
    return Button(text='Hello World')

TestApp().run()

I get this error我收到这个错误

C:\Users\Helquin\PycharmProjects\Reddit\ok\Scripts\python.exe C:/Users/Helquin/PycharmProjects/Reddit/Guiexample.py
[INFO   ] [Logger      ] Record log in C:\Users\Helquin\.kivy\logs\kivy_19-09-19_40.txt
[INFO   ] [deps        ] Successfully imported "kivy_deps.gstreamer" 0.1.17
[INFO   ] [deps        ] Successfully imported "kivy_deps.glew" 0.1.12
[INFO   ] [deps        ] Successfully imported "kivy_deps.sdl2" 0.1.22
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "C:\Users\Helquin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\kivy\__init__.py"
[INFO   ] [Python      ] v3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)]
[INFO   ] [Python      ] Interpreter at "C:\Users\Helquin\PycharmProjects\Reddit\ok\Scripts\python.exe"
[INFO   ] [Factory     ] 184 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_pil, img_gif (img_sdl2, img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: pil(['text_sdl2'] ignored)
[CRITICAL] [Window      ] Unable to find any valuable Window 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\Helquin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\kivy\core\__init__.py", line 63, in core_select_lib
    fromlist=[modulename], level=0)
  File "C:\Users\Helquin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\kivy\core\window\window_sdl2.py", line 27, in <module>
    from kivy.core.window._window_sdl2 import _WindowSDL2Storage

[CRITICAL] [App         ] Unable to get a Window, abort.

Process finished with exit code 1

I tried uninstalling and re-installing as mentioned in sdl2 - ImportError: DLL load failed: The specified module could not be found and [CRITICAL] [App] Unable to get a Window, abort post我尝试按照sdl2 中所述卸载并重新安装 - ImportError: DLL load failed: The specified module could not be found and [CRITICAL] [App] Unable to get a Window, abort post

I also tried to follow a video made this year in case I made some mistake but that didn't help.我还尝试关注今年制作的视频,以防我犯了一些错误,但这并没有帮助。

(I am using Pycharms, on a windows 10 (home) 64 bit, 16 Gb ram (我正在使用 Pycharms,在 windows 10(家庭)64 位,16 Gb 内存

So in case, anyone else has this issue, I just made it in pycharm then ran it straight from CMD.因此,以防万一,其他人有这个问题,我只是在 pycharm 中制作它,然后直接从 CMD 运行它。 Not sure why this works, but even the developers couldn't figure it out不知道为什么会这样,但即使是开发人员也无法弄清楚

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Kivy 错误(python 2.7):sdl2 导入错误 - Kivy error (python 2.7) : sdl2 import error 如何修复&#39;sdl2 - ImportError:DLL加载失败&#39;PyCharm中的错误 - How to Fix 'sdl2 - ImportError: DLL load failed' Error in PyCharm 如何让 Kivy 在 Linux 上使用 sdl2? - How can I get Kivy to use sdl2 on Linux? 如何将 kivy 文本渲染从 sdl2 更改为 pango? - How to change the kivy text render from sdl2 to pango? 如何修复没有名为 Kivy 的模块? 已经尝试过其他线程的 PATH 方法并安装 Kivy 多种不同的方式 - How to fix No Module named Kivy? Have already tried PATH method from other thread and installing Kivy multiple different ways 在Kivy中使用sdl2而不是pygame - using sdl2 in Kivy instead of pygame 使用SDL2在centos 7上运行kivy 1.9.1 - Run kivy 1.9.1 with SDL2 on centos 7 尝试使用 Python27 运行 Kivy 应用程序时出错:引发异常(&#39;SDL2:无法加载图像&#39;) - Error when trying to run Kivy app with Python27: raise Exception('SDL2: Unable to load image') SDL2 错误:“无法加载图像<default.png> " 使用 pyinstaller 冻结 kivy 应用程序时</default.png> - SDL2 Error: "Unable to load image <default.png>" when freezing kivy application using pyinstaller 如何让Kivy 1.9.1或1.9.2在OSX 10.12.2上使用SDL2而不是pygame? - How to I get Kivy 1.9.1 or 1.9.2 to use SDL2 instead of pygame on OSX 10.12.2?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM