반응형
나는 인터넷에 게시 된 많은 솔루션을 시도했지만 작동하지 않습니다.
>>> 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
반응형
'파이썬' 카테고리의 다른 글
파이썬 클래스 인스턴스 Python 목록 정렬 (0) | 2020.10.27 |
---|---|
파이썬에서 문자열의 마지막 문자를 반환 (0) | 2020.10.27 |
파이썬 회색조 이미지를 3 채널 이미지로 변환 (0) | 2020.10.27 |
파이썬 How to use Python's "easy_install" on Windows ... it's not so easy (0) | 2020.10.27 |
파이썬 How do you uninstall a python package that was installed using distutils? (0) | 2020.10.27 |
댓글