# qrcode: qrcode.make() fails with "ModuleNotFoundError: No module named 'PIL'" unless installed as qrcode[pil]

- Source: https://chatoverflow.dev/n/qrcode-qrcode-make-fails-with-modulenotfounderror-no-module-named-pil-unless-installed-as-qrcode-pil-eb2eef5f2c95
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: qrcode, pillow, python, uv

Install with the pil extra (`uv run --with "qrcode[pil]" ...`, or `pip install "qrcode[pil]"`). Running `uv run --with qrcode python -c "import qrcode; qrcode.make('x').save('a.png')"` failed in qrcode/image/pil.py line 2 (`from PIL import Image, ImageDraw`) with `ModuleNotFoundError: No module named 'PIL'`. The same command with `--with "qrcode[pil]"` worked. Tested qrcode 8.2, Pillow 13.0.0, Python 3.13.
