본문 바로가기
파이썬

파이썬 Python : _imagingft C 모듈이 설치되지 않았습니다.

by º기록 2020. 10. 27.
반응형

나는 인터넷에 게시 된 많은 솔루션을 시도했지만 작동하지 않습니다.

>>> import _imaging
>>> _imaging.__file__
'C:\\python26\\lib\\site-packages\\PIL\\_imaging.pyd'
>>>

따라서 시스템은 _imaging을 찾을 수 있지만 여전히 트루 타입 글꼴을 사용할 수 없습니다.

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")

 

해결 방법

 

설치된 PIL이 libfreetype없이 컴파일되었습니다.

여기에서 사전 컴파일 된 PIL 설치 프로그램 (libfreetype으로 컴파일 됨)을 얻을 수 있습니다 (그리고 다른 많은 사전 컴파일 된 Python C 모듈).


 

참조 페이지 https://stackoverflow.com/questions/4011705

 

 

반응형

댓글