Kivy运行错误。无法找到任何有价值的文字提供商

时间:2018-04-16 21:16:30

标签: python python-3.x kivy

Windows 10机器。 安装了两个python版本。 3.6.5和3.5。 3.4也安装和删除。 由于这是我的第一步,也许我搞砸了所有这些装置。

第一个基本的kivy应用程序。

import kivy

kivy.require('1.10.0')

from kivy.app import App
from kivy.uix.button import Label


class HelloKivy(App):
    def build(self):
        return Label(text='Hi')


hellowKivy = HelloKivy()

hellowKivy.run()

运行应用程序时,这是错误:

[INFO   ] Logger: Record log in C:\Users\Oren\.kivy\logs\kivy_18-04-16_40.txt [INFO   ] Kivy: v1.10.0 [INFO   ] Python: v3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] [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\Oren\venv\HellowKivy2\lib\site-packages\kivy\core\__init__.py", line 59, in core_select_lib
    fromlist=[modulename], level=0)   File "C:\Users\Oren\venv\HellowKivy2\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\Oren\venv\HellowKivy2\lib\site-packages\kivy\core\__init__.py", line 59, in core_select_lib
    fromlist=[modulename], level=0)   File "C:\Users\Oren\venv\HellowKivy2\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.


As far as I understand everything is installed. Here is the CMD opuput.

**C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64>.\python.exe -m pip install --upgrade pip wheel setuptools**

Requirement already up-to-date: pip in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (10.0.0)
Requirement already up-to-date: wheel in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (0.31.0)
Requirement already up-to-date: setuptools in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (39.0.1)

**C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64>.\python.exe -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew**

Requirement already satisfied: docutils in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (0.14)
Requirement already satisfied: pygments in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (2.2.0)
Requirement already satisfied: pypiwin32 in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (223)
Requirement already satisfied: kivy.deps.sdl2 in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (0.1.17)
Requirement already satisfied: kivy.deps.glew in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (0.1.9)
Requirement already satisfied: pywin32>=223 in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (from pypiwin32) (223)

**C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64>.\python.exe -m pip install kivy.deps.gstreamer**

Requirement already satisfied: kivy.deps.gstreamer in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (0.1.12)

**C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64>.\python.exe -m pip install kivy.deps.angle**

Requirement already satisfied: kivy.deps.angle in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (0.1.6)

**C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64>.\python.exe -m pip install kivy**

Requirement already satisfied: kivy in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (1.10.0)
Requirement already satisfied: Kivy-Garden>=0.1.4 in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (from kivy) (0.1.4)
Requirement already satisfied: docutils in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (from kivy) (0.14)
Requirement already satisfied: pygments in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (from kivy) (2.2.0)
Requirement already satisfied: requests in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (from Kivy-Garden>=0.1.4->kivy) (2.18.4)
Requirement already satisfied: certifi>=2017.4.17 in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (from requests->Kivy-Garden>=0.1.4->kivy) (2018.1.18)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (from requests->Kivy-Garden>=0.1.4->kivy) (1.22)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (from requests->Kivy-Garden>=0.1.4->kivy) (3.0.4)
Requirement already satisfied: idna<2.7,>=2.5 in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (from requests->Kivy-Garden>=0.1.4->kivy) (2.6)

我使用pcCharm。

编辑:

Check the project Interpreter setting screen shot

pip和setuptools不是最新版本。这是一个问题吗?

我尝试升级为描述here

但是当我尝试pip --version时出现错误

Fatal error in launcher: Unable to create process using '""c:\program files (x86)\microsoft visual studio\shared\python36_64\python.exe"  "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Scripts\pip.exe" --version'

不确定是什么意思。

1 个答案:

答案 0 :(得分:0)

正如 eyllanesc 所暗示的那样,项目本地解释器缺少一些软件包(可能这个术语是错误的)。 通过pyCharm文件安装软件包|设置| Project Interpreter解决了这个问题。 必须安装kivi依赖项(sdl2,glew)以及Pillow。