Kivy: "Unable to find any valuable Window provider" [SOLVED]
I have installed Kivy.
I followed the instructions for Python3 "Using software packages (PPA etc.)" here:
https://kivy.org/doc/stable/installation/installation-linux.html#using-software-packages-ppa-etc
I started with the following "Hello world" test:
import kivy
kivy.require('1.11.1') # 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()
But I get the following error. Can anyone help me?:
/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/venv/bin/python /mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/geo-esp-ny/geo-esp.py
[INFO ] [Logger ] Record log in /home/henrik/.kivy/logs/kivy_19-10-15_7.txt
[INFO ] [Kivy ] v1.11.1
[INFO ] [Kivy ] Installed at "/usr/lib/python3/dist-packages/kivy/__init__.py"
[INFO ] [Python ] v3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0]
[INFO ] [Python ] Interpreter at "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/venv/bin/python"
[INFO ] [Factory ] 184 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. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes
egl_rpi - ImportError: cannot import name 'bcm'
File "/usr/lib/python3/dist-packages/kivy/core/__init__.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
File "/usr/lib/python3/dist-packages/kivy/core/window/window_egl_rpi.py", line 12, in <module>
from kivy.lib.vidcore_lite import bcm, egl
sdl2 - ImportError: libSDL2_image-2.0.so.0: cannot open shared object file: No such file or directory
File "/usr/lib/python3/dist-packages/kivy/core/__init__.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
File "/usr/lib/python3/dist-packages/kivy/core/window/window_sdl2.py", line 27, in <module>
from kivy.core.window._window_sdl2 import _WindowSDL2Storage
x11 - ModuleNotFoundError: No module named 'kivy.core.window.window_x11'
File "/usr/lib/python3/dist-packages/kivy/core/__init__.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
[CRITICAL] [App ] Unable to get a Window, abort.
Process finished with exit code 1
Please sign in to leave a comment.
There is a difference because your terminal uses another interpreter.
You need to run it with the same one /mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/venv/bin/python /mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/geo-esp-ny/geo-esp.py
Well... Further searching, specifically in askubuntu.com, got me to this solution:
https://askubuntu.com/questions/615108/issues-finding-the-location-of-package-libsdl2-image-2-0-0 .
In short: Run this command in Terminal:
That solved it. Strangely enough, since Sergey's suggestions (etc.) did not have anything to do with that command!
Have you tried running it from the system terminal (outside of PyCharm) using the same interpreter?
Does the same problem appear?
I seem to have more than one Python3 version on my Ubuntu machine.
So when I write "python3 geo-esp.py" in Terminal, I get the same error, but there are a few differences in the message:
Here are the specifics from PyCharm:
[INFO ] [Python ] v3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0]
[INFO ] [Python ] Interpreter at "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/venv/bin/python"
And here are the specifics from Terminal:
[INFO ] [Python ] v3.6.8 (default, Oct 7 2019, 12:59:55)
[GCC 8.3.0]
[INFO ] [Python ] Interpreter at "/usr/bin/python3"
I must admit I am not sure why there are these differences?
Any help will be very appreciated. Thank you.
Well - that command in Terminal gives this:
henrik@Henrik-L570:/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/geo-esp-ny$ /mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/venv/bin/python /mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/geo-esp-ny/geo-esp.py
[INFO ] [Logger ] Record log in /home/henrik/.kivy/logs/kivy_19-10-16_0.txt
[INFO ] [Kivy ] v1.11.1
[INFO ] [Kivy ] Installed at "/usr/lib/python3/dist-packages/kivy/__init__.py"
[INFO ] [Python ] v3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0]
[INFO ] [Python ] Interpreter at "/mnt/4AF15A0435E762B4/DataDoc/OneDrive/PycharmProjects/2d-graphics/venv/bin/python"
[INFO ] [Factory ] 184 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. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes
egl_rpi - ImportError: cannot import name 'bcm'
File "/usr/lib/python3/dist-packages/kivy/core/__init__.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
File "/usr/lib/python3/dist-packages/kivy/core/window/window_egl_rpi.py", line 12, in <module>
from kivy.lib.vidcore_lite import bcm, egl
sdl2 - ImportError: libSDL2_image-2.0.so.0: cannot open shared object file: No such file or directory
File "/usr/lib/python3/dist-packages/kivy/core/__init__.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
File "/usr/lib/python3/dist-packages/kivy/core/window/window_sdl2.py", line 27, in <module>
from kivy.core.window._window_sdl2 import _WindowSDL2Storage
x11 - ModuleNotFoundError: No module named 'kivy.core.window.window_x11'
File "/usr/lib/python3/dist-packages/kivy/core/__init__.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
[CRITICAL] [App ] Unable to get a Window, abort.
So you got the same error. It means that the issue is not related to PyCharm.
Try searching for similar problems. For example https://github.com/kivy/kivy/issues/5859 and https://stackoverflow.com/questions/40697876/unable-to-get-a-window-abort
Thank you for your reply!
I have been looking at the solutions you refer to plus several other related discussions. But the concrete information there is all about MS-Windows, and I use Ubuntu, so it doesn't actually help.
Specifically there are references to where python(3) is installed on Windows (7 or 10). I have tried "translating" the OS specific information from Windows to my Ubuntu 18.04.3 LTS. I tried inserting '/usr/bin/python3', but that didn't solve the problem.
So I really don't know what to do. (Except maybe trying to ask the same question somewhere else.)
https://intellij-support.jetbrains.com/hc/en-us/community/posts/360006373979/comments/360000846780
you solved my issue; Thanks :)