1

I get an error when trying to run a kivy app:

This is my code:

import kivy

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()

This is the error:

C:\Users\Admin\PycharmProjects\pygame_project\venv\Scripts\python.exe C:/Users/Admin/PycharmProjects/pygame_project/kivyapp.py
[INFO   ] [Logger      ] Record log in C:\Users\Admin\.kivy\logs\kivy_19-07-17_11.txt
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "C:\Users\Admin\PycharmProjects\pygame_project\venv\lib\site-packages\kivy\__init__.py"
[INFO   ] [Python      ] v3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)]
[INFO   ] [Python      ] Interpreter at "C:\Users\Admin\PycharmProjects\pygame_project\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\Admin\PycharmProjects\pygame_project\venv\lib\site-packages\kivy\core\__init__.py", line 63, in core_select_lib
    fromlist=[modulename], level=0)
  File "C:\Users\Admin\PycharmProjects\pygame_project\venv\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\Admin\PycharmProjects\pygame_project\venv\lib\site-packages\kivy\core\__init__.py", line 63, in core_select_lib
    fromlist=[modulename], level=0)
  File "C:\Users\Admin\PycharmProjects\pygame_project\venv\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.
Gino Mempin
  • 12,644
  • 19
  • 50
  • 69
  • Possible duplicate of [ImportError: No module named PIL](https://stackoverflow.com/questions/8863917/importerror-no-module-named-pil) – Gino Mempin Jul 16 '19 at 23:36

1 Answers1

0

Your error is due to the following:

pil - ModuleNotFoundError: No module named 'PIL'

what python --version are you using ?

Try installing pip install Pillow

Note: PIL is depreciated, Pillow is newer one.

Chitkaran Singh
  • 786
  • 1
  • 5
  • 15