Kivy. Text provider error

青春壹個敷衍的年華 提交于 2019-12-19 07:00:31

问题


Start a simple sample of "Hello world". And got an error.

[CRITICAL] [Text        ] Unable to find any valuable Text provider at all!
[CRITICAL] [App         ] Unable to get a Text provider, abort.

Is it mean that I have no some font libs? Tried to install dev libs of actual fonts in system.

System: Centos. Python version 2.7


回答1:


You are missing the SDL TTF library required by PyGame. On Ubuntu, this is a system package called "libsdl-ttf2.0-dev". I think on CentOS it is called "SDL_ttf-devel". You can ensure you have the rest of the PyGame dependencies installed by looking at this PyGame install for RedHat page.




回答2:


According to kivy.core.text code:

...

# Load the appropriate provider

Label = core_select_lib('text', (
    ('pygame', 'text_pygame', 'LabelPygame'),
    ('sdlttf', 'text_sdlttf', 'LabelSDLttf'),
    ('pil', 'text_pil', 'LabelPIL'),
))

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)

...

, your system is missing required package. Install one of them first.




回答3:


Try to install Pillow

pip install Pillow



回答4:


just be sure that you already have all dependencies installed, look at the installation section of the kivy wiki




回答5:


I know this is an old post. I though of adding this if some body is searching for the same issue...

For Fedora 25 the best is to install "pygame"

dnf install pygame
dnf install pygame-devel

For me this resolved the issue.

Further to setup working Kivy environment in Fedora (I use Fedora 25), make sure all the dependencies are installed as below,

 dnf install make
 dnf install mercurial
 dnf install automake
 dnf install gcc
 dnf install gcc-c++
 dnf install SDL_ttf-devel
 dnf install SDL_mixer-devel
 dnf install khrplatform-devel
 dnf install mesa-libGLES
 dnf install mesa-libGLES-devel
 dnf install gstreamer-plugins-good
 dnf install gstreamer
 dnf install gstreamer-python
 dnf install mtdev-devel
 dnf install python-devel
 dnf install python-pip
 dnf install pygame
 dnf install pygame-devel

I mentioned those as separate commands as some of these comes by default.

Ref: https://kivy.org/docs/installation/installation-linux.html#fedora



来源:https://stackoverflow.com/questions/21697195/kivy-text-provider-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!