简体   繁体   中英

How to Fix 'sdl2 - ImportError: DLL load failed' Error in PyCharm

I am trying to learn Kivy Framework to develop a simple App to display a Label. I am using PyCharm IDE.

But when I click on Run, The following Error message occurs:

[CRITICAL] [Text] Unable to find any valuable Text provider.

sdl2 - ImportError: DLL load failed: The specified module could not be found.

pil - ImportError: No module named PIL

Here is my code:

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


class MyApp(App):
def build(self):
    return Label(text="This is a Label")

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

Pycharm runs in its own virtual environment, so you need to install all the kivy dependecies in pycharm.
Depending on if you are on windows or linux, the dependecies for windows and linux are listed on those pages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM