Python的PIL模块出现字体错误

时间:2013-10-08 13:58:11

标签: python python-imaging-library

尝试在Windows上使用Python 2.7运行脚本时,使用kivy框架,会生成以下错误:

[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安装模块,并且我尝试了here的预编译可执行文件;这两种选择都没有关于如何解决问题的任何其他建议?谢谢。

0 个答案:

没有答案