Fix: ModuleNotFoundError: No module named 'pkg_resources' (Stable Diffusion WebUI) #17375
solowjin23-debug
started this conversation in
General
Replies: 1 comment
-
|
Your going to love this issue. We don't run windows, but we assume it is same issue. Bottom line it comes to correcet versions of pip/python and doing manual install of CLIP. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
During installation, you may encounter errors like:
ModuleNotFoundError: No module named 'pkg_resources'
ERROR: Failed to build CLIP
error: subprocess-exited-with-error
This is caused by:
setuptools >= 82 (removes pkg_resources)
pip >= 24 (pulls incompatible dependencies)
Solution
Force compatible package versions using a constraints file.
Step 1 — Create pip-constraints.txt
In your stable-diffusion-webui root folder, create:
Add the following:
setuptools<82
pip<24
wheel<0.45
Step 2 — Edit webui-user.bat
Open webui-user.bat and add this line:
@echo off
set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=
set PIP_CONSTRAINT=pip-constraints.txt
call webui.bat
Step 3 — Remove broken environment
Delete the existing virtual environment:
stable-diffusion-webui/venv
Step 4 — Run WebUI
Start again:
webui-user.bat
you will get another error "Repository not found:
https://github.com/Stability-AI/stablediffusion.git" then delete the repositories folder and enter in cmd "set COMMANDLINE_ARGS=--skip-install
webui-user.bat"
I struggled with this for over 8 hours with AI and other solutions but it worked
Beta Was this translation helpful? Give feedback.
All reactions