Runtime ErrorAll platformsWeasyPrint < 53 · Pillow 10+

AttributeError: 'super' object has no attribute 'transform'

pip install weasyprint
from weasyprint import HTML
HTML(string="<p>Hello</p>").write_pdf("out.pdf")
AttributeError: 'super' object has no attribute 'transform'
File ".../PIL/ImageCms.py", line ..." in apply_transform
super().transform(...)

Pillow 10.0 removed the Image.ANTIALIAS constant and restructured the transform API. WeasyPrint versions before 53.0 call internal Pillow methods that no longer exist in Pillow 10+, causing AttributeError at render time.

Any · WeasyPrint <53 + Pillow 10+
crashes
Any · WeasyPrint 53+ + Pillow 10+
ok
Any · WeasyPrint <53 + Pillow 9.x
ok (old Pillow)

1Upgrade WeasyPrint to 53+Easiest

WeasyPrint 53.0 updated its Pillow integration to be compatible with Pillow 10+. Upgrade both packages together.

pip install --upgrade weasyprint pillow
2Pin Pillow to 9.x (temporary)Alternative

If upgrading WeasyPrint is not immediately possible, pin Pillow to the last 9.x release. Pillow 9.x is no longer receiving security updates — migrate as soon as practical.

pip install "pillow<10.0"

weasyprint · Compatibility Matrix
See install results across all Python versions and operating systems
Observed in 27 searches · Last verified Aug 2026
AttributeError: 'super' object has no attribute 'transform' — weasyprint