My Code:
import kivy
from kivy.app import App
from kivy.uix.label import Label
class MyApp(App):
def build(self):
return Label(text="sdMickey")
if __name__ == "__main__":
MyApp().run()
the Error:
C:\Users\soham\PycharmProjects\test\venv\Scripts\python.exe C:/Users/soham/PycharmProjects/test/main.py
[INFO ] [Logger ] Record log in C:\Users\soham\.kivy\logs\kivy_20-05-27_82.txt
[INFO ] [deps ] Successfully imported "kivy_deps.gstreamer" 0.1.18
[INFO ] [deps ] Successfully imported "kivy_deps.angle" 0.1.10
[INFO ] [deps ] Successfully imported "kivy_deps.glew" 0.1.12
[INFO ] [deps ] Successfully imported "kivy_deps.sdl2" 0.1.23
[INFO ] [Kivy ] v1.11.1
[INFO ] [Kivy ] Installed at "C:\Users\soham\AppData\Local\Programs\Python\Python36\lib\site-packages\kivy\__init__.py"
[INFO ] [Python ] v3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)]
[INFO ] [Python ] Interpreter at "C:\Users\soham\PycharmProjects\test\venv\Scripts\python.exe"
[INFO ] [Factory ] 184 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. 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 - ImportError: DLL load failed: The specified module could not be found.
File "C:\Users\soham\AppData\Local\Programs\Python\Python36\lib\site-packages\kivy\core\__init__.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
File "C:\Users\soham\AppData\Local\Programs\Python\Python36\lib\site-packages\kivy\core\text\text_sdl2.py", line 13, in <module>
from kivy.core.text._text_sdl2 import (_SurfaceContainer, _get_extents,
pil - ModuleNotFoundError: No module named 'PIL'
File "C:\Users\soham\AppData\Local\Programs\Python\Python36\lib\site-packages\kivy\core\__init__.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
File "C:\Users\soham\AppData\Local\Programs\Python\Python36\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.
Process finished with exit code 1
I have tried many sites and tutorials but haven't found anything that works for me. Right now I've tried these:
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
They didn't work
I have tried installing kivy on python 3.6, 3.7 & 3.8 and i am running this code on pycharm. I also tried installing packages in the project interpreter (specifically kivy-deps), it still doesn't work.
None of the above solutions have worked, they give the same error.
Please help.
I have found a temporary solution to it. The problem is when you use kivy in a virtual environment which is the case most of the time in PyCharm. So, to counter that i use my existing python.exe file as my System integrator instead of creating a virtual environment. this seems to work for me.