Kivy error (python 2.7) : sdl2 import error

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

Img01 - SDL2 Error
Img02 - Python Interpreter Settings Before Change
Img03 - Python Interpreter Settings Changed
Img04 - Run Kivy App
Img05 - SDL2

Leave a Comment