8

[PROBLEM] How can I bypass kivy module error: ImportError: DLL load failed: The specified module could not be found ?

Note: I have installed kivy with: pip install kivy.
Note: I have tried also with : python v 2.7.10 but to no avail.
Note: OS - Windows 7, 64-bit

[CODE] - this snippet is taken from kiwi org homepage.

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

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

TestApp().run()

[CURRENT OUTPUT]

[INFO              ] [Logger      ] Record log in C:\Users\testUser\.kivy\logs\kivy_16-01-22_1.txt
[INFO              ] [Kivy        ] v1.9.1
[INFO              ] [Python      ] v2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)]
[INFO              ] [Factory     ] 179 symbols loaded

 Traceback (most recent call last):
   File "C:\Users\testUser\Desktop\test_kivy.py", line 1, in <module>
     from kivy.app import App
   File "C:\Python27\lib\site-packages\kivy\app.py", line 327, in <module>
     from kivy.uix.widget import Widget
   File "C:\Python27\lib\site-packages\kivy\uix\widget.py", line 219, in <module>
     from kivy.graphics import (
   File "C:\Python27\lib\site-packages\kivy\graphics\__init__.py", line 89, in <module>
     from kivy.graphics.instructions import Callback, Canvas, CanvasBase, \
 ImportError: DLL load failed: The specified module could not be found.
george
  • 685
  • 2
  • 9
  • 22
  • Answered here: http://stackoverflow.com/questions/34823579/how-do-you-fix-kivy-graphics-dll-issue/34970460#34970460 – KSully2 Jan 24 '16 at 19:50
  • @KSully. I have tried your suggestion in the same time I still face that problem. I'll keep digging... – george Jan 25 '16 at 10:13

7 Answers7

21

On Windows, glew and sdl2 are required as dependencies. I had the same problem. Installing all the dependencies

python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew

and then reinstalling kivy worked for me.

qwr
  • 9,525
  • 5
  • 58
  • 102
4

If you have already installed kivy in windows without installing dependencies use these command separately It will work,

python -m pip install kivy.deps.sdl2

python -m pip install kivy.deps.glew 
2

I had the same problem. The answer is:

  1. pip uninstall docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew -clears previous versions from user Folder and then again:
  2. pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew

And it works fine!

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Dimon
  • 21
  • 1
1

I had this same error message. Maybe the same cause, maybe something different.

I am using PyCharm 5 and had installed Kivy using PyCharm's Settings > Project Interpreter interface to my user folder.
I removed that installation of Kivy by navigating to the AppData user folder and deleting the kivy folders there.

I then installed Kivy to the Python site-packages folder (by not ticking the option to install to the user folder), and it worked for me.

Lindsay Ward
  • 469
  • 4
  • 11
1

All you have to do is the following - first run this in your cmd:

python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew

Next you will see on the cmd whether it is installed or upgraded

Now just you have to know the problem it still not working that you downloaded the dependencies which it kivy.deps.sdl2 and kivy.deps.glew in the following directory C:\Python27\Lib\site-packages because you used pip

When you need it to be in the same directory but in the kivy file

C:\Python27\Lib\site-packages\kivy 

then the all you have to do that copy paste the file from

 C:\Python27\Lib\site-packages   

to be in

 C:\Python27\Lib\site-packages\kivy 

and it will work

Alexander Farber
  • 21,519
  • 75
  • 241
  • 416
0

For pycharm, got to PyCharm's Settings > Project Interpreter and install kivy.deps.sdl2 and kivy.deps.glew packages. Worked for me.

Rosan Grg
  • 11
  • 1
  • 3
0

My two cents on this issue: I had all dependencies installed, but was still getting this issue. The reason was that I installed them using

pip install --user docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew 

Once I removed the --user flag and re-installed all dependencies and kivy, the system was able to find the DLLs and run the Kivy application.

Alexander Pacha
  • 9,187
  • 3
  • 68
  • 108