Install Pillow into the environment that runs Django: activate the project's virtual environment (or use its
interpreter directly) and run python -m pip install pillow, then add pillow to
requirements.txt. If Pillow is already installed there, run python -c "from PIL import Image"
from the project folder: the real error is whatever that prints.
The error
We reproduced it with a one-app project containing this model, in an environment that has Django 6 but no Pillow:
from django.db import models
class Product(models.Model):
name = models.CharField(max_length=100)
photo = models.ImageField(upload_to="products/")
python manage.py check
SystemCheckError: System check identified some issues:
ERRORS:
shop.Product.photo: (fields.E210) Cannot use ImageField because Pillow is not installed.
HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".
System check identified 1 issue (0 silenced).
It is a system check error, so it appears on runserver, migrate, makemigrations and
check alike, and it stops all of them.
Case 1: Pillow is not in this environment
python -m pip install --quiet pillow
python manage.py check
System check identified no issues (0 silenced).
The usual cause is installing Pillow into a different Python than the one running manage.py: globally instead of
in the project's virtual environment, or the other way round. In production, it is usually a requirements.txt
without Pillow, so the Docker image or server was built without it. Print what the project actually uses:
import sys
import django
import PIL
print("Python: ", sys.executable)
print("Django: ", django.__version__, "from", django.__file__)
print("Pillow: ", PIL.__version__, "from", PIL.__file__)
Python: /home/you/.venv/bin/python
Django: 6.1.2 from /home/you/.venv/lib/python3.13/site-packages/django/__init__.py
Pillow: 12.3.0 from /home/you/.venv/lib/python3.13/site-packages/PIL/__init__.py
Run that with the same command or IDE configuration that starts Django. The install guide covers virtual environments on each OS.
Case 2: Pillow is installed, but cannot be imported
Django runs from PIL import Image and treats any ImportError as "not installed". So a broken
Pillow produces exactly the same message. Here a stray copy of Pillow without its compiled core sits next to
manage.py:
python manage.py check
shop.Product.photo: (fields.E210) Cannot use ImageField because Pillow is not installed.
HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".
System check identified 1 issue (0 silenced).
Django's message hides the real problem. Import Pillow yourself, from the same folder and environment:
python -c "from PIL import Image"
ImportError: cannot import name '_imaging' from 'PIL' (/home/you/project/PIL/__init__.py)
Now the cause is visible, and the fix is the one for that error: here,
cannot import name '_imaging'. Other causes that look the same from
Django: a file or folder named PIL in the project
(see No module named 'PIL'), a Pillow wheel for another Python version
or platform copied into a deployment, and missing system libraries on unusual Linux images.
Do you need ImageField at all?
ImageField is a FileField that also opens each upload with Pillow to check it is an image and
can record its width and height (width_field, height_field). If you don't want that validation, a
FileField works without Pillow. But the check is worth having: it rejects files that only pretend to be images,
and you will probably want Pillow anyway to make thumbnails.
Related
The outputs and images on this page are the real results of running every example with Pillow 12.3.0 on Python 3.13 (Linux) on 2026-10-15. Every example is also re-run automatically on macOS (Darwin 25.6.0, Pillow 12.3.0), Linux (Linux 6.17.0-1022-azure, Pillow 12.3.0), Windows (Windows 2025Server, Pillow 12.3.0); the line under each example shows the result per operating system. The DejaVu Sans font files sit next to each script so font examples behave the same everywhere. Sample photos: NASA/Sam Lott, public domain. Spotted something wrong? Tell us.