Ich habe versucht, Kivy (1.10.0) in pycharm zu verwenden, wenn es darum ging, die Installation mit zu testen:
from kivy.app import App
from kivy.uix.button import Button
class TutorialApp(App):
def build(self):
return Button(text='Hello Kivy')
if __== '__main__':
TutorialApp().run()
dies wurde auch mit 'Label' anstelle von 'Button' versucht
Ich bekam dies, wenn ich beide Male in pycharm lief:
[INFO ] [Logger ] Record log in C:\Users\Denise\.kivy\logs\kivy_17-08-12_56.txt
[INFO ] [Kivy ] v1.10.0
[INFO ] [Python ] v3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [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: The specified module could not be found.
File "C:\Users\Denise\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kivy\core\__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "C:\Users\Denise\AppData\Local\Programs\Python\Python36-32\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\Denise\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kivy\core\__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "C:\Users\Denise\AppData\Local\Programs\Python\Python36-32\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.
Der gleiche Fehler trat in der Python 3.6.1-Shell auf, wenn Folgendes eingegeben wurde:
from kivy.uix.button import Button
oder
from kivy.uix.button import Lable
Bitte helfen Sie, wie kann ich Kivy zum Laufen bringen?
Gemäß dem Quellcode
if 'KIVY_DOC' not in os.environ:
if not Label:
from kivy.logger import Logger
import sys
Logger.critical('App: Unable to get a Text provider, abort.')
sys.exit(1)
Stellen Sie sicher, dass Sie alle Abhängigkeiten gemäß Installationsanleitung installiert haben.
Fügen Sie in PyCharmm im Projektinterpreter alle Pakete hinzu, die beginnen mit:
kivy-Deps.
Mit Ausnahme der mit "dev" im Titel
pip install --upgrade pip wheel setuptools
pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew
pip install kivy.deps.gstreamer
pip install kivy.deps.angle
pip install –-upgrade kivy
Dies wird all dieses Problem lösen
Ich war mit diesem Problem konfrontiert, dann tat ich das ... (Dies ist für Leute, die pycharm verwenden und alle Pakete installiert haben, aber immer noch nicht funktionieren)
Unter Einstellungen-> Projektinterpreter -> Grünes Plus-Symbol das Paket installieren
Suchen Sie dann nach "kivy.deps.sdl2" und installieren Sie.
Ich hoffe das hilft.
refer: https://github.com/kivy/kivy/issues/5677#issuecomment-389980378-permalink James 'Antwort hilft mir gut ... unter Windows kann es durch Voranstellen "gelöst" werden %AppData%\Python\share\glew\bin;%AppData%\Python\share\sdl2\bin;
an PFAD: