Solving Kivy ImportError: DLL load failed: The specified module could not be found

Kivy ImportError: DLL load failed: The specified module could not be found is an error which occurs when you have a fauly kivy installation.

This post is my attempt to explain to you why this error occurs and how you can solve it, I will also include multiple solutions that could be considered as alternative fixes to the error.

Exploring the Error : Kivy ImportError: DLL load failed: The specified module could not be found

Kivy ImportError: DLL load failed: The specified module could not be found is an error which occurs when you have a fauly kivy installation.

                                                                       #
sdl2 - ImportError: DLL load failed: The specified module could not be found.from 
kivy.core.window._window_sdl2 import _WindowSDL2Storage
.....
[CRITICAL] [App         ] Unable to get a Window, abort.
  Exception ignored in: 'kivy.properties.dpi2px'
  Traceback (most recent call last):
      EventLoop.ensure_window()
      sys.exit(1)
SystemExit: 1
[CRITICAL] [App         ] Unable to get a Window, abort.
                                                                       #

The error should look like this. Double check in order to avoid mixing between errors.

Bellow are the solutions which worked for me and will help you to successfully solve your problem.

Solution 1 : remove literally everything then install kivy.

Both solutions in this blog post are step by step solutions, so pay attention and please do not miss any step.

First, Download and install as admin and choose a custom installation also make sure you install it in a known folder, for example c:/programs/python38

While installing python you should see “add to PATH variable to system” please check it.

Also make sure you download it from the official link https://www.python.org/downloads/

Now close everything and then run the command line cmd as admin.

Run these two commands , one by one

                                                                       #
python -m pip install --upgrade pip wheel setuptools
python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew
                                                                       #

Then install the kivy deps one by one using the command bellow

                                                                       #
python -m pip install kivy.deps.gstreamer
python -m pip install kivy.deps.angle
                                                                       #

And then install kivy using pip with this command

                                                                       #
python -m pip install kivy
                                                                       #

If this solution does not fix your problem you can try the second and last solution

Solution 2 : uninstall and install kivy and the kivy dependencies.

The first solution is at the same time similar and different from the first one.

First start by removing Kivy and the kivy dependencies

Let us remove kivy with this command

                                                                       #
python -m pip uninstall kivy
                                                                       #

Now, remove the dependencies using three commands

                                                                       #
python -m pip uninstall kivy.deps.gstreamer
python -m pip uninstall kivy.deps.glew
python -m pip uninstall kivy.deps.sdl2
                                                                       #

Then uninstall image

                                                                       #
python -m pip uninstall image
                                                                       #

The second step is to install setuptools

                                                                       #
python -m pip install --upgrade pip wheel setuptools
                                                                       #

Let us install the dependencies of kivy

                                                                       #
python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew --extra-index-url https://kivy.org/downloads/packages/simple/
                                                                       #

Finally, let us install kivy. And please do not install gstreamer again

                                                                       #
python -m pip install kivy
                                                                       #

The solution should be enough, please try the final solution if this fails.

If this article has been useful for your particular case, consider donating to our Kofi account, there is a red button at the top of this page.

Summing-up

The article is over, I hope I have been able to help you solve this error or at least guide you in the right direction, check out other solutions to different errors you can do that by using the search bar on top of this page.

Keep learning, keep coding guys, cheers. If you want to learn more about Python, please check out the Python Documentation : https://docs.python.org/3/