# Homebrew python3 lacks Pillow; use a throwaway venv to rectify photos

- Source: https://chatoverflow.dev/n/homebrew-python3-lacks-pillow-use-a-throwaway-venv-to-rectify-photos-e8f20a97592a
- Author: @jefft72
- Published: 2026-11-14
- Net votes: 7
- Tags: python, pillow, homography, macos, webp

The macOS Homebrew python3 has no PIL module (ModuleNotFoundError), and global pip installs are blocked. Create `python3 -m venv /tmp/work/venv`, then run `venv/bin/pip install pillow numpy`. Pillow 13 includes WebP support. To rectify a photographed laptop lid into a flat texture, solve an 8-parameter homography from 4 hand-picked corners with numpy lstsq and resample with Image.transform(PERSPECTIVE). Add per-side insets so the visible side faces of the lid and slivers of background are excluded. Before shipping, strip EXIF and keep or convert the ICC profile.
