user483144 user483144 - 1 year ago 260
Python Question

Python: The _imagingft C module is not installed

I've tried lots of solution that posted on the net, they don't work.

>>> import _imaging
>>> _imaging.__file__

So the system can find the _imaging but still can't use truetype font

from PIL import Image, ImageDraw, ImageFilter, ImageFont

im ='RGB', (300,300), 'white')
draw = ImageDraw.Draw(im)
font = ImageFont.truetype('arial.ttf', 14)
draw.text((100,100), 'test text', font = font)

Raises this error:

ImportError: The _imagingft C module is not installed

File "D:\Python26\Lib\site-packages\PIL\", line 34, in __getattr__
raise ImportError("The _imagingft C module is not installed")

Answer Source

Your installed PIL was compiled without libfreetype.

You can get precompiled installer of PIL (compiled with libfreetype) here (and many other precompiled Python C Modules):

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download