PIL Issue, OSError: cannot open resource

I fixed the problem by using default font.

font = ImageFont.load_default()

If you just need to put some text (font style is not matter to you) then this might be a simple solution.

font = ImageFont.load_default()

draw = ImageDraw.Draw(pil_img)
draw.text(( 20, 32), "text_string", (255,0,0), font=font)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)