python -m pip install --upgrade pip wheel setuptools
python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew
python -m pip install kivy.deps.gstreamer
python -m pip install kivy.deps.angle
python -m pip install kivy
python -m pip install kivy_examples
python -m pip install Pillow
python -m pip install cython
python -m pip install PyEnchant
Hi, I am trying to run the example code from the install Kivy. The following is the error I receive back. Any help would be great. I have tried looking at previous enquiries about similar problems, but nothing suggested on them has worked so far.
[INFO ] [Logger ] Record log in C:\Users\DoddJ\.kivy\logs\kivy_18-03-26_52.txt
[INFO ] [Kivy ] v1.10.0
[INFO ] [Python ] v3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)]
[INFO ] [Factory ] 194 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_pil, img_gif (img_sdl2, img_ffpyplayer ignored)
[INFO ] [Text ] Provider: pil(['text_sdl2'] ignored)
[CRITICAL] [Window ] Unable to find any valuable Window provider.
sdl2 - ImportError: DLL load failed: The specified module could not be found.
File "C:\Users\dev.DoddJ\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kivy\core\__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "C:\Users\dev.DoddJ\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kivy\core\window\window_sdl2.py", line 26, in <module>
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):
File "C:\Users\dev.DoddJ\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kivy\utils.py", line 496, in __get__
retval = self.func(inst)
File "C:\Users\dev.DoddJ\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kivy\metrics.py", line 174, in dpi
EventLoop.ensure_window()
File "C:\Users\dev.DoddJ\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kivy\base.py", line 127, in ensure_window
sys.exit(1)
SystemExit: 1
[CRITICAL] [App ] Unable to get a Window, abort.
Code that I am trying to run:
import kivy
kivy.require('1.10.0') # replace with your current kivy version !
from kivy.app import App
from kivy.uix.label import Label
class MyApp(App):
def build(self):
return Label(text='Hello world')
if __name__ == '__main__':
MyApp().run()
I had the same problem. I solved this by removing Kivy and its dependencies first.
python -m pip uninstall kivy
python -m pip uninstall kivy.deps.sdl2
python -m pip uninstall kivy.deps.glew
python -m pip uninstall kivy.deps.gstreamer
python -m pip uninstall image
Now reinstalling everything except gstreamer.
python -m pip install --upgrade pip wheel setuptools
python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew --extra-index-url https://kivy.org/downloads/packages/simple/
python -m pip install kivy
It solved the error. Credits to Ben R's Answer.
07-2021, Python 3.9
The problem is that the PATH variable has not been set (Python installation from the Windows Store).
**from the windows menu/browser:
remove program
at the beginning remove any python installation, this will make life easier**
It is best to download python from python.org and install as ADMINISTRATOR as "CUSTOM" with a known path (for all users) IE c:/programs/python39
Be sure to check:
add to PATH variable to system
Now, after installing python - we log out and log back in. Then in the start menu look for CMD and run !!! as administrator
From the admin position, install as stated on the website: https://kivy.org/doc/stable-1.10.1/installation/installation-windows.html
ie:
python -m pip install --upgrade pip wheel setuptools
python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew
python -m pip install kivy.deps.gstreamer
python -m pip install kivy.deps.angle
and finally
python -m pip install kivy
and that solves the whole problem.
Ps. Ifyou write angin command IE:
python -m pip install kivy.deps.angle
Location of files should be show as IE:
c:/programs/python39....
But not as your home directory
(But it will be if you run cmd as normal user...and then IT doesen't work.... But if you have all files on your home directory YOU HAVE TO REMOVE ALL BEFORE YOU START:
python -m pip uninstall docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew
And then (as admin): python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew
I had the very same problem, and for me the solution was to make use of virtualenv instead of venv. This forces Kivy to use a specific installation of Python.
Download and install Python 3.7, since 3.8 doesn't seem to be supported yet (https://www.python.org/downloads/release/python-376/)
Install virtualenv if not already installed
pip install virtualenv
Create a virtual environment, specifying the path to the newly installed Python version
virtualenv --python=C:\path\to\Python37\python.exe my_venv
Activate the new virtual environment
my_venv/Scripts/activate.bat
Install kivy according to Javapocalypse's answer
python -m pip install --upgrade pip wheel setuptools
python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew extra-index-url https://kivy.org/downloads/packages/simple/
python -m pip install kivy
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With