How to Install pillow in Python
Python Imaging Library (fork)
pip install pillow
What is pillow?
Python Imaging Library (fork)
Pillow is the friendly PIL fork by Jeffrey 'Alex' Clark and contributors. PIL is the Python Imaging Library by Fredrik Lundh and contributors. As of 2019, Pillow development is supported by Tidelift.
The Python Imaging Library adds image processing capabilities to your Python interpreter.
This library provides extensive file format support, an efficient internal representation, and fairly powerful image processing capabilities.
Quick Start
Minimal example to get started with pillow:
from PIL import Image
img = Image.open("photo.jpg")
print(img.size) # (width, height)
print(img.mode) # RGB
thumb = img.resize((200, 200))
thumb.save("thumbnail.jpg")
Installation
pip (standard)
pip install pillow
Virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install pillow
pip3
pip3 install pillow
conda
conda install -c conda-forge pillow
Poetry
poetry add pillow
Verify the Installation
After installing, confirm the package is available:
python -c "import PIL; print(PIL.__version__)"
If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.
Installation Errors
Common errors when installing pillow with pip.
ModuleNotFoundError: No module named 'PIL'
Cause: The package is not installed in the current Python environment.
Fix: Run pip install pillow. If using a virtual environment, ensure it is activated first.
ModuleNotFoundError: No module named 'PIL' (installed but still failing)
Cause: pip installed the package into a different Python than the one running your script.
Fix: Use python -m pip install pillow to install into the interpreter you are running.
ImportError: cannot import name 'X' from 'PIL'
Cause: The function or class does not exist in the installed version.
Fix: Check the version with pip show pillow and upgrade with pip install --upgrade pillow.
pip: command not found
Cause: pip is not in PATH or Python was not added to PATH during installation.
Fix: Try python -m pip install pillow. On macOS/Linux try pip3.
PermissionError: [Errno 13] Permission denied
Cause: No write access to the system Python package directory.
Fix: Use a virtual environment, or add --user: pip install --user pillow
SSL: CERTIFICATE_VERIFY_FAILED
Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.
Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org pillow
Runtime Errors
Common errors when using pillow after installation.
OSError: cannot identify image file
Cause: The file is not a valid image, is corrupted, or the path is wrong.
Fix: Verify the path exists with os.path.exists(path). Confirm it's a valid image by opening it in a viewer.
PIL.UnidentifiedImageError
Cause: Pillow cannot determine the image format from the file header.
Fix: Ensure the file is not truncated or zero bytes. Check if the extension matches the actual format.
Recent Releases
| Version | Released |
|---|---|
12.2.0 latest |
2026-04-01 |
12.1.1 |
2026-02-11 |
12.1.0 |
2026-01-02 |
12.0.0 |
2025-10-15 |
11.3.0 |
2025-07-01 |
Manage pillow
Upgrade to latest version
pip install --upgrade pillow
Install a specific version
pip install pillow==12.2.0
Uninstall
pip uninstall pillow
Check what is installed
pip show pillow