我試過很多在網上發佈的解決方案,但它們不起作用。Python:_imagingft C模塊未安裝
>>> import _imaging
>>> _imaging.__file__
'C:\\python26\\lib\\site-packages\\PIL\\_imaging.pyd'
>>>
,以便系統可以找到_imaging但仍然無法使用TrueType字體
from PIL import Image, ImageDraw, ImageFilter, ImageFont
im = Image.new('RGB', (300,300), 'white')
draw = ImageDraw.Draw(im)
font = ImageFont.truetype('arial.ttf', 14)
draw.text((100,100), 'test text', font = font)
引發此錯誤:
ImportError: The _imagingft C module is not installed
File "D:\Python26\Lib\site-packages\PIL\ImageFont.py", line 34, in __getattr__
raise ImportError("The _imagingft C module is not installed")
它可以在Linux上使用嗎?我只看到了.exe文件:< – user483144 2010-10-25 03:27:19
如果你想要linux二進制文件,你將不得不從你的發行版的軟件庫中獲取它。 – Imran 2010-10-25 03:40:36
這正是我需要在Windows上獲得TTF支持的原因。加載_imagingft.pyd時,官方頁面上的PIL二進制文件遇到了sxs問題。謝謝! – 2010-10-25 05:49:30