How to run Kivy with Python 3? Kivy error: "Unable to find any valuable Window provider at all"
<p>I want to use <code>kivy</code> with <code>Python 3</code> on <code>Ubuntu 16.04</code> in VirtualBox.</p>

<p>However, when I try to run the following minimal code with <code>Python 3:</code></p>

<pre><code>from kivy.app import App
from kivy.uix.label import Label

class TestApp(App):
    def build(self):
        return Label(text="hello kivy")

TestApp().run()
</code></pre>

<p>I get the error below. </p>

<pre><code>$ python3 test.py
[INFO   ] [Logger      ] Record log in /home/openstack/.kivy/logs/kivy_16-10-08_7.txt
[INFO   ] [Kivy        ] v1.9.0
[INFO   ] [Python      ] v3.5.2 (default, Sep 10 2016, 08:21:44) 
[GCC 5.4.0 20160609]
[INFO   ] [Factory     ] 173 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 &lt;multiprocessing&gt; for socket
[INFO   ] [Window      ] Provider: sdl2(['window_egl_rpi'] ignored)
[CRITICAL] [Window      ] Unable to find any valuable Window provider at all!
egl_rpi - ImportError: cannot import name 'bcm'
  File "/usr/lib/python3/dist-packages/kivy/core/__init__.py", line 57, in core_select_lib
    fromlist=[modulename], level=0)
  File "/usr/lib/python3/dist-packages/kivy/core/window/window_egl_rpi.py", line 12, in &lt;module&gt;
    from kivy.lib.vidcore_lite import bcm, egl

sdl2 - TypeError: expected bytes, str found
  File "/usr/lib/python3/dist-packages/kivy/core/__init__.py", line 65, in core_select_lib
    cls = cls()
  File "/usr/lib/python3/dist-packages/kivy/core/window/window_sdl2.py", line 121, in __init__
    super(WindowSDL, self).__init__()
  File "/usr/lib/python3/dist-packages/kivy/core/window/__init__.py", line 616, in __init__
    self.create_window()
  File "/usr/lib/python3/dist-packages/kivy/core/window/window_sdl2.py", line 171, in create_window
    self.fullscreen, resizable, state)
  File "kivy/core/window/_window_sdl2.pyx", line 60, in kivy.core.window._window_sdl2._WindowSDL2Storage.setup_window (kivy/core/window/_window_sdl2.c:1447)

x11 - ImportError: No module named 'kivy.core.window.window_x11'
  File "/usr/lib/python3/dist-packages/kivy/core/__init__.py", line 57, in core_select_lib
    fromlist=[modulename], level=0)

[CRITICAL] [App         ] Unable to get a Window, abort.
 Exception ignored in: 'kivy.properties.dpi2px'
 Traceback (most recent call last):
   File "/usr/lib/python3/dist-packages/kivy/utils.py", line 360, in __get__
     retval = self.func(inst)
   File "/usr/lib/python3/dist-packages/kivy/metrics.py", line 169, in dpi
     EventLoop.ensure_window()
   File "/usr/lib/python3/dist-packages/kivy/base.py", line 126, in ensure_window
     sys.exit(1)
 SystemExit: 1
[CRITICAL] [App         ] Unable to get a Window, abort.
</code></pre>

<p>While I get no problems running the same code under <code>Python 2:</code></p>

<pre><code>$ python test.py
[INFO   ] [Logger      ] Record log in /home/openstack/.kivy/logs/kivy_16-10-08_11.txt
[INFO   ] [Kivy        ] v1.9.0
[INFO   ] [Python      ] v2.7.12 (default, Jul  1 2016, 15:12:24) 
[GCC 5.4.0 20160609]
[INFO   ] [Factory     ] 173 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 &lt;multiprocessing&gt; for socket
[INFO   ] [Window      ] Provider: sdl2(['window_egl_rpi'] ignored)
[INFO   ] [GL          ] OpenGL version &lt;3.0 Mesa 11.2.0&gt;
[INFO   ] [GL          ] OpenGL vendor &lt;VMware, Inc.&gt;
[INFO   ] [GL          ] OpenGL renderer &lt;Gallium 0.4 on llvmpipe (LLVM 3.8, 256 bits)&gt;
[INFO   ] [GL          ] OpenGL parsed version: 3, 0
[INFO   ] [GL          ] Shading version &lt;1.30&gt;
[INFO   ] [GL          ] Texture max size &lt;8192&gt;
[INFO   ] [GL          ] Texture max units &lt;18&gt;
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [Base        ] Start application main loop
[INFO   ] [GL          ] NPOT texture support is available
[INFO   ] [Base        ] Leaving application in progress...
</code></pre>

<h2>Any suggestions how to run Kivy with Python 3?</h2>

<p>BTW, the following are installed successfully:</p>

<pre><code>$ sudo apt-get install libsdl2-2.0-0 libsdl2-image-2.0-0 libsdl2-mixer-2.0-0 libsdl2-ttf-2.0-0
$ sudo apt-get install python3-pil
$ sudo apt-get install python-setuptools python-pygame python-opengl python-gst0.10 python-enchant gstreamer0.10-plugins-good python-dev build-essential libgl1-mesa-dev libgles2-mesa-dev python-pip libgstreamer1.0-dev
</code></pre>