kivy: Kivy not working after installation
I was installing kivy for the first time:
python -m pip install --upgrade pip wheel setuptools
python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew \ kivy.deps.gstreamer --extra-index-url https://kivy.org/downloads/packages/simple/
python -m pip install kivy
but after i run:
from kivy.app import App
from kivy.uix.button import Button
class TestApp(App):
def build(self):
return Button(text='Hello World')
TestApp().run()
i would get
C:\Python27\python.exe "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 5.0.4\helpers\pycharm\utrunner.py" "C:\- Python_projekti\python_GUI_testiranje\testiranje.py" true
Testing started at 19:33 ...
[INFO ] [Logger ] Record log in C:\Users\Kyte\.kivy\logs\kivy_16-03-24_4.txt
[INFO ] [Kivy ] v1.9.1
[INFO ] [Python ] v2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)]
[INFO ] [Factory ] 179 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_sdl2 (img_pil, img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2
[INFO ] [OSC ] using <thread> for socket
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] GLEW initialization succeeded
[INFO ] [GL ] OpenGL version <4.5.13399 Compatibility Profile Context 15.201.1151.1008>
[INFO ] [GL ] OpenGL vendor <ATI Technologies Inc.>
[INFO ] [GL ] OpenGL renderer <AMD Radeon R7 200 Series>
[INFO ] [GL ] OpenGL parsed version: 4, 5
[INFO ] [GL ] Shading version <4.40>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <32>
[WARNING ] [Image ] Unable to load image <C:\Python27\lib\site-packages\kivy\data\glsl\default.png>
[CRITICAL ] [Window ] Unable to find any valuable Window provider at all!
sdl2 - Exception: SDL2: Unable to load image
File "C:\Python27\lib\site-packages\kivy\core\__init__.py", line 67, in core_select_lib
cls = cls()
File "C:\Python27\lib\site-packages\kivy\core\window\window_sdl2.py", line 138, in __init__
super(WindowSDL, self).__init__()
File "C:\Python27\lib\site-packages\kivy\core\window\__init__.py", line 722, in __init__
self.create_window()
File "C:\Python27\lib\site-packages\kivy\core\window\window_sdl2.py", line 255, in create_window
super(WindowSDL, self).create_window()
File "C:\Python27\lib\site-packages\kivy\core\window\__init__.py", line 897, in create_window
self.render_context = RenderContext()
File "kivy\graphics\instructions.pyx", line 756, in kivy.graphics.instructions.RenderContext.__init__ (kivy\graphics\instructions.c:10729)
File "C:\Python27\lib\site-packages\kivy\core\image\__init__.py", line 512, in __init__
self.filename = arg
File "C:\Python27\lib\site-packages\kivy\core\image\__init__.py", line 700, in _set_filename
mipmap=self._mipmap, nocache=self._nocache)
File "C:\Python27\lib\site-packages\kivy\core\image\__init__.py", line 430, in load
im = loader(filename, **kwargs)
File "C:\Python27\lib\site-packages\kivy\core\image\__init__.py", line 198, in __init__
self._data = self.load(filename)
File "C:\Python27\lib\site-packages\kivy\core\image\img_sdl2.py", line 42, in load
raise Exception('SDL2: Unable to load image')
[CRITICAL ] [App ] Unable to get a Window, abort.
Exception SystemExit: 1 in 'kivy.properties.dpi2px' ignored
[CRITICAL ] [App ] Unable to get a Window, abort.
Process finished with exit code 1
and i went to kivy IRC for help. two guys helped me out. i did:
python -m pip uninstall pillow
python -m pip install --use-wheel pillow
and after that i would run my app, but with some modification and it is working now
import os
os.environ['KIVY_IMAGE'] = 'pil,sdl2'
from kivy.app import App
from kivy.uix.button import Button
class TestApp(App):
def build(self):
return Button(text='Hello World')
TestApp().run()
One more time thank to quanon and kived from the IRC channel. They are the best 😃
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 24 (12 by maintainers)
I am getting very same issue as OP. First i tried the following standard - gave me this error:
Tried adding:
import os os.environ['KIVY_IMAGE'] = 'pil,sdl2'
Just gives mes this and now GUI 😃
[INFO ] [Logger ] Record log in C:\Users\Buch\.kivy\logs\kivy_17-12-15_99.txt [INFO ] [Kivy ] v1.10.0 [INFO ] [Python ] v3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] [INFO ] [Factory ] 194 symbols loaded [INFO ] [Image ] Providers: (img_tex, img_dds, img_ffpyplayer, img_gif, img_pil, img_sdl2 ignored) [CRITICAL] [App ] Unable to get any Image provider, abort.
Kind regards
I’m not exactly sure the point of this issue. This is very a likely a problem specific to that user’s computer because it doesn’t happen otherwise.
I have you install all dependencies ? Install All is needed. See the kivy website
2017-12-23 7:08 GMT+01:00 Jrius Kaxibwe notifications@github.com: