ModuleNotFoundError: No module named 'pydantic_settings' in ComfyUI
Fix ComfyUI No module named pydantic_settings errors by installing pydantic-settings in the exact Python environment that starts ComfyUI.
If ComfyUI repeats No module named 'pydantic_settings', install the package named pydantic-settings in the same Python environment that launches ComfyUI.
The import name uses an underscore: pydantic_settings. The pip package name uses a hyphen: pydantic-settings. That mismatch is the main trap.
In the SEO Lab portable repair, this warning appeared many times while ComfyUI tried to parse pyproject.toml files. Installing pydantic-settings did not fix every remaining warning by itself, but it removed a large block of repeated noise and exposed the next real missing package.
Fast answer
For the GitHub Windows portable package:
.\python_embeded\python.exe -s -m pip show pydantic-settings
.\python_embeded\python.exe -s -m pip install pydantic-settings
.\python_embeded\python.exe -s -c "import pydantic_settings; print('import ok')"
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-buildDo not run pip install pydantic_settings. Use pydantic-settings.
What The Log Looks Like
The repeated warning often looks like this:
Unable to parse pyproject.toml due to lack dependency pydantic-settings,
please run 'pip install -r requirements.txt': No module named 'pydantic_settings'You may see the same line many times because ComfyUI or a plugin scans multiple package metadata files during startup.
Quick Diagnosis
| What You See | Meaning | First Action |
|---|---|---|
No module named 'pydantic_settings' | The import module is missing | Install pydantic-settings |
The log says pip install -r requirements.txt | A dependency file may include it | Still install into the Python that starts ComfyUI |
| The line repeats dozens of times | Metadata parsing is noisy | Fix this package, then restart and read the shorter log |
| A new missing package appears after restart | You fixed one layer | Continue with the new first blocker |
pydantic is installed but this still fails | pydantic-settings is a separate package | Install the separate package |
Step 1: Confirm The Active Python
For Windows portable, run from the folder that contains python_embeded and ComfyUI:
.\python_embeded\python.exe -s -c "import sys; print(sys.executable)"
.\python_embeded\python.exe -s -m pip show pydantic pydantic-settingsFor a manual venv:
python -c "import sys; print(sys.executable)"
python -m pip show pydantic pydantic-settingsIf the path points to system Python instead of your ComfyUI environment, stop and switch environments before installing.
Step 2: Install The Right Package Name
Windows portable:
.\python_embeded\python.exe -s -m pip install pydantic-settingsManual venv:
python -m pip install pydantic-settingsThen verify the import name:
.\python_embeded\python.exe -s -c "import pydantic_settings; print('import ok')"Step 3: Restart And Read The Shorter Log
Restart ComfyUI:
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-buildIf the pydantic_settings warnings disappear but a new ModuleNotFoundError appears, treat the new line as the next package in the repair chain. Do not paste a long list of unrelated dependencies into the environment just to silence the first warning.
What Not To Do
- do not install
pydantic_settings; that is the import name, not the pip package name - do not assume
pydanticincludespydantic-settings - do not run system
pipwhen ComfyUI starts frompython_embeded - do not treat repeated metadata warnings as proof that the whole ComfyUI folder is unrecoverable
- do not keep installing packages after Torch, CUDA, or OpenCV conflicts appear; switch to the dependency conflict guide
Related Guides
- Repair ComfyUI Portable Dependencies One Missing Module At A Time
- Fix No module named errors in ComfyUI
- ComfyUI Dependency Conflicts
- ComfyUI Plugin Import Failed
- No module named 'simpleeval' in ComfyUI
Source References
- Windows portable SEO Lab repair, May 18, 2026: repeated
No module named 'pydantic_settings'while parsingpyproject.toml - Same lab cleanup action:
pip install pydantic-settingsreduced the repeated warning block before the next missing package was handled - pydantic-settings 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 packagesDid this fix your issue?
Your answer helps prioritize verified ComfyUI repairs.