'Kivy error, [CRITICAL] [Text ] unable to find any valuable text provider (python 3.6.1) (windows 10)
I have been trying to use Kivy (1.10.0) in pycharm, when it came to testing the install with:
from kivy.app import App
from kivy.uix.button import Button
class TutorialApp(App):
def build(self):
return Button(text='Hello Kivy')
if __name__ == '__main__':
TutorialApp().run()
this was also tried with 'Label' in place of 'Button'
I got this when ran in pycharm both times:
[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.
The same error occurred in python 3.6.1 shell when typing the following:
from kivy.uix.button import Button
or
from kivy.uix.button import Lable
Please help, how do I get Kivy to run?
Solution 1:[1]
In PyCharmm in the Project Interpreter, add all the packages that start with:
kivy-deps.
With the exclusion of the ones with "dev" in the title
Solution 2:[2]
According to the source code
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)
Make sure you have installed all the dependencies according to installation guide.
Solution 3:[3]
I was facing this problem, then I did this... ( This is for people using pycharm and installed all packages but still not working)
In settings->Project Interpreter ->Green Plus Icon to install package
Then search for "kivy.deps.sdl2", and install.
I hope this helps.
Solution 4:[4]
refer: https://github.com/kivy/kivy/issues/5677#issuecomment-389980378-permalink
James's answer help me well.
on Windows, it can be "solved" by prepending %AppData%\Python\share\glew\bin;%AppData%\Python\share\sdl2\bin; to PATH:
Solution 5:[5]
The way I solved this error is by creating a virtual environment and running the program on the virtual environment
(kivy_venv) C:\Users\musers\PycharmProjects\kivy-projects>python main.py
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Apoleo |
| Solution 2 | Juggernaut |
| Solution 3 | Saikat halder |
| Solution 4 | Zoe stands with Ukraine |
| Solution 5 | Idevelopers geek |
