Kivy error (python 2.7) : sdl2 import error

前端 未结 6 1502
我在风中等你
我在风中等你 2020-11-28 16:46

I\'m trying to use kivy on my Python 2.7 project (in a PyCharm - Windows 10 environment), but I get the following error.

If someone can help me ? Thanks !

PS

6条回答
  •  佛祖请我去吃肉
    2020-11-28 17:13

    Problem

    It is looking for the Kivy dependencies (e.g. sdl2) in your virtualenv.

    Solution

    I have encountered the same problem. I did the following and it solved the problem.

    Environment

    • Windows 10
    • PyCharm Community
    • Python 3.5
    • Kivy dependencies installed (docutils, pygments, pypiwin32, kivy.deps.sdl2, kivy.deps.glew, kivy.deps.gstreamer) and for Python 3.5+ (kivy.deps.angle)

    PyCharm IDE

    1. Open the project
    2. Click File
    3. Click Settings...
    4. Click Project Interpreter
    5. On the right panel, click the drop down list for Project Interpreter
    6. Select the location where the Python interpreter is installed e.g. C:\Users\user-name\AppData\Local\Programs\Python\Python35\python.exe
    7. Click OK until you exit the Settings window
    8. Run your program

    Output

提交回复
热议问题