简体   繁体   English

Kivy。 文本提供程序错误

[英]Kivy. Text provider error

Start a simple sample of "Hello world". 开始一个简单的“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. 试图在系统中安装dev libs的实际字体。

System: Centos. 系统:Centos。 Python version 2.7 Python版本2.7

According to kivy.core.text code: 根据kivy.core.text代码:

...

# 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. 首先安装其中一个。

You are missing the SDL TTF library required by PyGame. 您缺少PyGame所需的SDL TTF库。 On Ubuntu, this is a system package called "libsdl-ttf2.0-dev". 在Ubuntu上,这是一个名为“libsdl-ttf2.0-dev”的系统包。 I think on CentOS it is called "SDL_ttf-devel". 我认为在CentOS上它被称为“SDL_ttf-devel”。 You can ensure you have the rest of the PyGame dependencies installed by looking at this PyGame install for RedHat page . 通过查看RedHat页面的PyGame安装,您可以确保安装了其余的PyGame依赖项。

尝试安装枕头

pip install Pillow

只需确保已经安装了所有依赖项,请查看kivy wiki安装部分

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" 对于Fedora 25,最好是安装“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, 进一步在Fedora中设置工作Kivy环境(我使用Fedora 25),确保所有依赖项都安装如下,

 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//kivy.org/docs/installation/installation-linux.html#fedora

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM