Reputation: 33
Hello everyone I'm trying to run a simple code directly from de console with :
python test.py
The code is this one:
import kivy.app
import kivy.uix.label
class TestApp(kivy.app.App):
def build(self):
return kivy.uix.label.Label(text="Hello World")
app = TestApp()
app.run()
When I try to run it ,it throws me this error:
[WARNING] [Deprecated ] Python 2 Kivy support has been deprecated. The Kivy release after 1.11.0 will not support Python 2 anymore
[INFO ] [Factory ] 184 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_pil, img_gif (img_pygame, img_ffpyplayer ignored)
[INFO ] [Text ] Provider: pil(['text_pygame'] 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 "/home/omar/.local/lib/python2.7/site-packages/kivy/core/__init__.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
File "/home/omar/.local/lib/python2.7/site-packages/kivy/core/window/window_egl_rpi.py", line 12, in <module>
from kivy.lib.vidcore_lite import bcm, egl
pygame - ImportError: No module named pygame
File "/home/omar/.local/lib/python2.7/site-packages/kivy/core/__init__.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
File "/home/omar/.local/lib/python2.7/site-packages/kivy/core/window/window_pygame.py", line 13, in <module>
import pygame
x11 - ImportError: No module named window_x11
File "/home/omar/.local/lib/python2.7/site-packages/kivy/core/__init__.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
[CRITICAL] [App ] Unable to get a Window, abort.
I've been looking for some solutions and some of them are to install the prerrequisites for Kivy but when I try to excecute the lines below:
python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew;
python -m pip install kivy.deps.gstreamer
It throws me the next ERROR:
ERROR: Could not find a version that satisfies the requirement kivy.deps.sdl2 (from versions: none)
ERROR: No matching distribution found for kivy.deps.sdl2
...and so on.
While I run all my codes in Windows I had no problem but on Ubuntu I dont know what to do.
I'm running on Ubuntu 18.04.4 LTS, I dont know what info should I give.
Upvotes: 0
Views: 592
Reputation: 61
I believe this is because you are running with python2 instead of python3. Linux comes with python2 as standard and even if you have python3 installed, it will run with python2 if you don't speak explicitly.
1- Make sure you have python3 installed.
2- Run python3 test.py
Upvotes: 1