Install & Compatibility
Where this runs
tested against v1.3.19 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
build_error
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.8s · import 0.004s · 21MB
19MB installed
● package 19MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Draw
✓ from aggdraw import Draw
✗ from aggdraw import aggdraw
The module is named 'aggdraw', but the main class is 'Draw'.
Pen
✓ from aggdraw import Pen
Brush
✓ from aggdraw import Brush
Creates a 200x200 white image, draws a red ellipse with a black outline, and displays it.
from PIL import Image
from aggdraw import Draw, Pen, Brush
img = Image.new('RGBA', (200, 200), 'white')
draw = Draw(img)
pen = Pen('black', 3)
brush = Brush('red')
draw.ellipse((50, 50, 150, 150), pen, brush)
draw.flush()
img.show()
Errors
Common errors & fixes
ImportError: cannot import name 'Draw' from 'aggdraw'
Incorrect import path. The class is in the top-level module.
fixUse: from aggdraw import Draw
ModuleNotFoundError: No module named 'aggdraw'
aggdraw is not installed or installation failed (requires compiler for C extension).
fixInstall with pip: pip install aggdraw. Ensure you have build tools (e.g., 'python3-dev' on Linux).
aggdraw.Draw: AttributeError: 'Draw' object has no attribute 'text'
The 'text' method was added in a later version or requires specific parameters.
fixUse aggdraw version >=1.2.0. For older versions, use PIL's ImageDraw.Draw.text instead.
RuntimeError: The truth value of an array with more than one element is ambiguous.
Confusion with numpy arrays, but aggdraw expects PIL Images.
fixConvert numpy array to PIL Image using Image.fromarray().
Upgrade
Version history
1.4.1latest on PyPI · released Dec 3, 2025
Audit
Dependencies
Pillowrequiredaggdraw requires Pillow (PIL fork) to provide image objects.