Kivy error (python 2.7) : sdl2 import error

China☆狼群 提交于 2019-11-27 16:24:00

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

Thank you so much, it did work ! I just added the "original" python interpreter installed in C:\Python27\python.exe in Project Interpreter list and selected it like you said.

Best regards,

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!