Kivy Testprogramm:
Code: Alles auswählen
import kivy
kivy.require('1.10.0')
from kivy.app import App
from kivy.uix.button import Label
class HelloKivy(App):
def build(self):
return Label(text ="Hello Geeks")
helloKivy = HelloKivy()
helloKivy.run()
Aber es gibt leider ein problem. Denn bei mir funktioniert unter Python die Kivy nicht einwandfrei. Denn unter IDLE Python erscheint zwar Kivy Fenster, aber es wird nur weiß angezeigt.
Und liebe Admins? Könnt ihr mein Forum Beitrag für mich Korriegieren, damit der Restliche Text unten nicht als Quellcode Anzeige anzeigt. Weil hier habe ich jetzt auch ein problem mit diese Forum das ab " v3.7.0 (v3.7.0:1bf9cc5093..." Text nur als Quelcode anzeigt, und ich weiß selber nicht wie ich das Problem beheben kann. Eigentlich möchte ich, das der ganze gepostete Fehlermeldung nur Rote Text anzeigt aber nicht als Quellcode
Und unter PyCharm ein andere Symptome das der Kivy Fenster nur kurz anzeigt und wieder schließt, und es zeigt dann diese Fehlermeldung:
Code: Alles auswählen
C:\Users\SSD3\PycharmProjects\pythonProject11\venv\Scripts\python.exe C:/Users/SSD3/PycharmProjects/pythonProject11/main.py
[INFO ] [Logger ] Record log in C:\Users\SSD3\.kivy\logs\kivy_22-05-14_4.txt
[INFO ] [deps ] Successfully imported "kivy_deps.angle" 0.3.2
[INFO ] [deps ] Successfully imported "kivy_deps.glew" 0.3.1
[INFO ] [deps ] Successfully imported "kivy_deps.sdl2" 0.4.5
[INFO ] [Kivy ] v2.1.0
[INFO ] [Kivy ] Installed at "C:\Users\SSD3\PycharmProjects\pythonProject11\venv\lib\site-packages\kivy\__init__.py"
[INFO ] [Python ] v3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
[INFO ] [Python ] Interpreter at "C:\Users\SSD3\PycharmProjects\pythonProject11\venv\Scripts\python.exe"
[INFO ] [Logger ] Purge log fired. Processing...
[INFO ] [Logger ] Purge finished!
[INFO ] [Factory ] 189 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2 (img_pil, img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] GLEW initialization succeeded
[INFO ] [GL ] Backend used <glew>
[INFO ] [GL ] OpenGL version <b'4.6.0 NVIDIA 466.63'>
[INFO ] [GL ] OpenGL vendor <b'NVIDIA Corporation'>
[INFO ] [GL ] OpenGL renderer <b'NVIDIA GeForce GTX 1650/PCIe/SSE2'>
[INFO ] [GL ] OpenGL parsed version: 4, 6
[INFO ] [GL ] Shading version <b'4.60 NVIDIA'>
[INFO ] [GL ] Texture max size <32768>
[INFO ] [GL ] Texture max units <32>
[WARNING] [Image ] Unable to load image <C:\Users\SSD3\PycharmProjects\pythonProject11\venv\lib\site-packages\kivy\data\glsl\default.png>
[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
sdl2 - Exception: SDL2: Unable to load image
File "C:\Users\SSD3\PycharmProjects\pythonProject11\venv\lib\site-packages\kivy\core\__init__.py", line 71, in core_select_lib
cls = cls()
File "C:\Users\SSD3\PycharmProjects\pythonProject11\venv\lib\site-packages\kivy\core\window\window_sdl2.py", line 165, in __init__
super(WindowSDL, self).__init__()
File "C:\Users\SSD3\PycharmProjects\pythonProject11\venv\lib\site-packages\kivy\core\window\__init__.py", line 1071, in __init__
self.create_window()
File "C:\Users\SSD3\PycharmProjects\pythonProject11\venv\lib\site-packages\kivy\core\window\window_sdl2.py", line 362, in create_window
super(WindowSDL, self).create_window()
File "C:\Users\SSD3\PycharmProjects\pythonProject11\venv\lib\site-packages\kivy\core\window\__init__.py", line 1450, in create_window
self.render_context = RenderContext()
File "kivy\graphics\instructions.pyx", line 797, in kivy.graphics.instructions.RenderContext.__init__
File "C:\Users\SSD3\PycharmProjects\pythonProject11\venv\lib\site-packages\kivy\core\image\__init__.py", line 561, in __init__
self.filename = arg
File "C:\Users\SSD3\PycharmProjects\pythonProject11\venv\lib\site-packages\kivy\core\image\__init__.py", line 756, in _set_filename
mipmap=self._mipmap, nocache=self._nocache)
File "C:\Users\SSD3\PycharmProjects\pythonProject11\venv\lib\site-packages\kivy\core\image\__init__.py", line 460, in load
im = loader(filename, **kwargs)
File "C:\Users\SSD3\PycharmProjects\pythonProject11\venv\lib\site-packages\kivy\core\image\__init__.py", line 223, in __init__
self._data = self.load(filename)
File "C:\Users\SSD3\PycharmProjects\pythonProject11\venv\lib\site-packages\kivy\core\image\img_sdl2.py", line 47, in load
raise Exception('SDL2: Unable to load image')
[CRITICAL] [App ] Unable to get a Window, abort.
Ich habe Stundenlang Gegooglet. Habe auch "python -m pip install docutils pyictions pypiwin32 kivy.deps.sdl2 kivy.deps.glew" probiert. Doch Pycharm zeigt bei installation nächste Fehlermeldung:
C:\Users\SSD3\PycharmProjects\pythonProject11>python -m pip install docutils pyictions pypiwin32 kivy.deps.sdl2 kivy.deps.glew
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: docutils in c:\users\ssd3\appdata\roaming\python\python37\site-packages (0.18.1)
ERROR: Could not find a version that satisfies the requirement pyictions (from versions: none)
ERROR: No matching distribution found for pyictions
Habe das ganze auch mit PowerShell probiert. Auch da kommt der nächste Fehlermeldung:
PS C:\WINDOWS\system32> python -m pip install docutils pyictions pypiwin32 kivy.deps.sdl2 kivy.deps.glew
Requirement already satisfied: docutils in c:\users\ssd3\appdata\roaming\python\python37\site-packages (0.18.1)
ERROR: Could not find a version that satisfies the requirement pyictions (from versions: none)
ERROR: No matching distribution found for pyictions
Und ja, ich verwende Python 3.7.0
Habe auch mit Python 3.10 probiert, auch da genau derselbe problem.
Hat jemand ein idee wie ich die Kivy zum laufen bringen kann? Weil auf mein Handy mit Pydroid3 funktioniert der Kivy einwandfrei. Nur auf mein Leisstungsstarke Windows Rechner gar nicht.