Kivy not working after installation
See original GitHub issueI 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 😃
Issue Analytics
- State:
- Created 7 years ago
- Comments:24 (12 by maintainers)
Top Results From Across the Web
No module named 'Kivy' even though I installed it
I installed Kivy through anaconda, so the files for kivy might be installed in a wrong directory. Either way, I don't know how...
Read more >Installing Kivy — Kivy 2.1.0 documentation
If a wheel is not available or is not working, Kivy can be installed from source with some additional steps. Installing from source...
Read more >Kivy cannot be installed because of some errors - Super User
1 Answer 1 · To ensure there are no issues, you may want to consider using the custom installation option rather than the...
Read more >Kivy Not Working Anymore - Reddit
Uninstalled Python 3.9, reinstalled Python 3.10, installed Kivy again: not allowed to download from pip. Did all of the following:.
Read more >Failing to install Kivy, followed instructions. Failing with error ...
You received this message because you are subscribed to the Google Groups "Kivy users support" group. To unsubscribe from this group and stop...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.