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)

Most upvoted comments

I am getting very same issue as OP. First i tried the following standard - gave me this error:

Purge log fired. Analysing… Purge 12 log files [INFO ] [Logger ] Record log in C:\Users\Buch.kivy\logs\kivy_17-12-15_98.txt Purge finished! [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_gif (img_sdl2, img_pil, img_ffpyplayer ignored) [CRITICAL] [Text ] Unable to find any valuable Text provider. sdl2 - ImportError: DLL load failed: Det angivne modul blev ikke fundet. File “C:\Users\Buch.virtualenvs\KEABAR\lib\site-packages\kivy\core_init_.py”, line 59, in core_select_lib fromlist=[modulename], level=0) File “C:\Users\Buch.virtualenvs\KEABAR\lib\site-packages\kivy\core\text\text_sdl2.py”, line 12, in <module> from kivy.core.text._text_sdl2 import (_SurfaceContainer, _get_extents,

pil - ModuleNotFoundError: No module named ‘PIL’ File “C:\Users\Buch.virtualenvs\KEABAR\lib\site-packages\kivy\core_init_.py”, line 59, in core_select_lib fromlist=[modulename], level=0) File “C:\Users\Buch.virtualenvs\KEABAR\lib\site-packages\kivy\core\text\text_pil.py”, line 7, in <module> from PIL import Image, ImageFont, ImageDraw

[CRITICAL] [App ] Unable to get a Text provider, abort.

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:

am failing to debug this…

c:\Python27>python c:\python27\share\kivy-examples\camera\main.py [INFO ] [Logger ] Record log in C:\Users\Kaxibwe.kivy\logs\kivy_17-12-2 _4.txt [INFO ] [Kivy ] v1.10.1.dev0, git-0456eff, 20171125 [INFO ] [Python ] v2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [M C v.1500 32 bit (Intel)] Traceback (most recent call last): File “c:\python27\share\kivy-examples\camera\main.py”, line 17, in from kivy.app import App File “c:\Python27\kivy\app.py”, line 319, in from kivy.base import runTouchApp, stopTouchApp File “c:\Python27\kivy\base.py”, line 26, in from kivy.clock import Clock File “c:\Python27\kivy\clock.py”, line 362, in from kivy._clock import CyClockBase, ClockEvent, FreeClockEvent, ImportError: DLL load failed: %1 is not a valid Win32 application.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kivy/kivy/issues/4115#issuecomment-353709443, or mute the thread https://github.com/notifications/unsubscribe-auth/AderOe6YVWP9EioZrPYS25IyNRHUO0QXks5tDJjKgaJpZM4H4U0B .