LogoWonderful Launcher
  • Home
  • Pricing
  • Docs
  • Download

ModuleNotFoundError: No module named 'PIL' in ComfyUI

Partially verifiedLow riskLast verified 2026-07-08

Fix ComfyUI No module named PIL errors by installing Pillow in the exact Python environment that starts ComfyUI.

If ComfyUI logs ModuleNotFoundError: No module named 'PIL', install Pillow. The import name is PIL, but the pip package name is Pillow.

This is the same kind of package-name mismatch as yaml versus PyYAML: the module users see in the traceback is not the name they should install.

In the SEO Lab portable repair chain, missing PIL appeared after PyYAML was installed. Installing Pillow moved the startup log forward to the next missing package.

Fast answer

For the GitHub Windows portable package:

.\python_embeded\python.exe -s -m pip show Pillow
.\python_embeded\python.exe -s -m pip install Pillow
.\python_embeded\python.exe -s -c "from PIL import Image; print('import ok')"
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build

Do not run pip install PIL.

What The Log Looks Like

Typical traceback:

ModuleNotFoundError: No module named 'PIL'

In ComfyUI this can surface during startup, image loading, image saving, preview generation, metadata handling, or custom nodes that manipulate images.

Quick Diagnosis

What You SeeMeaningFirst Action
No module named 'PIL'Pillow is missing from the active PythonInstall Pillow
pip install PIL failsWrong package nameUse pip install Pillow
Image nodes fail but models existPython imaging dependency is missingFix Pillow before moving model files
Error remains after installWrong Python was repairedRun pip show Pillow through ComfyUI's Python

Step 1: Check The Active Environment

Windows portable:

.\python_embeded\python.exe -s -c "import sys; print(sys.executable)"
.\python_embeded\python.exe -s -m pip show Pillow

Manual venv:

python -c "import sys; print(sys.executable)"
python -m pip show Pillow

The path must match the Python that starts ComfyUI.

Step 2: Install Pillow

Windows portable:

.\python_embeded\python.exe -s -m pip install Pillow

Manual venv:

python -m pip install Pillow

Then verify the import:

.\python_embeded\python.exe -s -c "from PIL import Image; print(Image.__name__)"

Step 3: Restart ComfyUI

.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build

If a new missing package appears, that means the repair chain moved forward. Continue one package at a time instead of guessing a long install command.

What Not To Do

  • do not install PIL; install Pillow
  • do not move image files or model files for a Python import error
  • do not install into system Python when ComfyUI uses python_embeded
  • do not downgrade Pillow unless a specific plugin compatibility note requires it
  • do not repair Pillow and Torch/CUDA at the same time; verify one change before the next

Related Guides

  • No module named 'yaml' in ComfyUI
  • Repair ComfyUI Portable Dependencies One Missing Module At A Time
  • Fix No module named errors in ComfyUI
  • ComfyUI Dependency Conflicts
  • Plugin Missing Module Warning: When It Is Safe to Ignore

Source References

  • Windows portable SEO Lab repair, May 18, 2026: ModuleNotFoundError: No module named 'PIL' appeared after installing PyYAML
  • Same lab cleanup action: pip install Pillow moved the startup log to the next missing dependency
  • Pillow on PyPI

Start free with Wonderful Launcher if this affects your real ComfyUI environment. It keeps launcher-native repair, task logs, and runtime checks in one place; credits are only for image generation and metered tools.

Download Wonderful LauncherSee credit packages

Did this fix your issue?

Your answer helps prioritize verified ComfyUI repairs.

Table of Contents

What The Log Looks Like
Quick Diagnosis
Step 1: Check The Active Environment
Step 2: Install Pillow
Step 3: Restart ComfyUI
What Not To Do
Related Guides
Source References