尝试在 Windows 上使用 kivy 框架使用 Python 2.7 运行脚本时,会生成以下错误:
[INFO ] [Base ] Start application main loop
[INFO ] [Base ] Leaving application in progress...
Traceback (most recent call last):
File "myApp.py", line 775, in <module>
MyApp().run()
File "C:\python27\lib\site-packages\kivy\app.py", line 600, in run
runTouchApp()
File "C:\python27\lib\site-packages\kivy\base.py", line 454, in runTouchApp
EventLoop.window.mainloop()
File "C:\python27\lib\site-packages\kivy\core\window\window_pygame.py", line 325, in mainloop
self._mainloop()
File "C:\python27\lib\site-packages\kivy\core\window\window_pygame.py", line 231, in _mainloop
EventLoop.idle()
File "C:\python27\lib\site-packages\kivy\base.py", line 294, in idle
Clock.tick()
File "C:\python27\lib\site-packages\kivy\clock.py", line 370, in tick
self._process_events()
File "C:\python27\lib\site-packages\kivy\clock.py", line 481, in _process_events
if event.tick(self._last_tick) is False:
File "C:\python27\lib\site-packages\kivy\clock.py", line 280, in tick
ret = callback(self._dt)
File "C:\python27\lib\site-packages\kivy\uix\label.py", line 200, in texture_update
self._label.refresh()
File "C:\python27\lib\site-packages\kivy\core\text\__init__.py", line 413, in refresh
sz = self.render()
File "C:\python27\lib\site-packages\kivy\core\text\__init__.py", line 252, in render
lw, lh = get_extents(line)
File "C:\python27\lib\site-packages\kivy\core\text\text_pil.py", line 33, in get_extents
font = self._select_font()
File "C:\python27\lib\site-packages\kivy\core\text\text_pil.py", line 27, in _select_font
font = ImageFont.truetype(fontname, fontsize)
File "C:\python27\lib\site-packages\PIL\ImageFont.py", line 218, in truetype
return FreeTypeFont(filename, size, index, encoding)
File "C:\python27\lib\site-packages\PIL\ImageFont.py", line 134, in __init__
self.font = core.getfont(file, size, index, encoding)
File "C:\python27\lib\site-packages\PIL\ImageFont.py", line 34, in __getattr__
raise ImportError("The _imagingft C module is not installed")
ImportError: The _imagingft C module is not installed
此错误似乎是由 PIL 模块生成的。我试过用 安装模块,我试过从这里easy_install
预编译的可执行文件;这两种选择都没有帮助。有关如何解决此问题的任何其他建议?谢谢你。