Skip to content

Fix CLIP installation failures#17293

Merged
catboxanon merged 1 commit intoAUTOMATIC1111:devfrom
WhizZest:dev
Feb 28, 2026
Merged

Fix CLIP installation failures#17293
catboxanon merged 1 commit intoAUTOMATIC1111:devfrom
WhizZest:dev

Conversation

@WhizZest
Copy link
Copy Markdown

Description

Summary

This PR fixes multiple CLIP installation issues that prevent Stable Diffusion WebUI from completing its initial setup. The core problem is that CLIP uses a pyproject.toml build system which requires proper build dependencies (wheel and setuptools) to be available during installation.

Technical Changes

  • Added a dedicated ensure_build_dependencies() function that checks and installs essential build tools before CLIP installation
  • Implemented setuptools version compatibility checking to prevent issues with setuptools >= 70
  • Modified CLIP installation to use --no-build-isolation flag to avoid build environment isolation issues
  • Consolidated build dependency management in the runtime logic rather than relying solely on requirements_versions.txt

Issues Fixed

This PR resolves the following reported issues:

Screenshots/videos:

Checklist:

@corbinrode
Copy link
Copy Markdown

none of these fixes work, just FYI.

@WhizZest
Copy link
Copy Markdown
Author

none of these fixes work, just FYI.

My solution received the most upvotes in issue #17201 (comment)

Many people have verified that my solution works.

So, could you provide detailed error information? I'd like to know why yours failed.

@goldman138
Copy link
Copy Markdown

somewhat new to this and github lol how would i go about implementing this?

@WhizZest
Copy link
Copy Markdown
Author

somewhat new to this and github lol how would i go about implementing this?

Prepare your Python 3.10.6 environment, and then execute the following command:

git clone https://github.com/WhizZest/stable-diffusion-webui.git
cd stable-diffusion-webui
git switch dev
git pull

Windows:

.\webui-user.bat

linux:

./webui.sh

@kuroganepanda
Copy link
Copy Markdown

Thank you! your solution worked for me.

@catboxanon catboxanon merged commit 76759a1 into AUTOMATIC1111:dev Feb 28, 2026
3 checks passed
@hirorohi03
Copy link
Copy Markdown

hirorohi03 commented Mar 2, 2026

I discovered an issue with this code. Regarding the ‘setuptools<70’ on lines 434 and 437, single quotes do not work on Windows. Consequently, the < is treated as a redirection, causing pip to exit with an error.
During the initial installation, setuptools 65.5.0 is installed elsewhere. Therefore, the checks on line 433 prevent lines 434 and 437 from executing, so no problem occurs.
However, if setuptools is removed or upgraded to version 70 or higher, the script will terminate with an error on either line 434 or 437.
As noted in requirements_versions.txt, the issue does not occur if setuptools==69.5.1. How about fixing it that way?

@WhizZest
Copy link
Copy Markdown
Author

WhizZest commented Mar 2, 2026

I discovered an issue with this code. Regarding the ‘setuptools<70’ on lines 434 and 437, single quotes do not work on Windows. Consequently, the < is treated as a redirection, causing pip to exit with an error. During the initial installation, setuptools 65.5.0 is installed elsewhere. Therefore, the checks on line 433 prevent lines 434 and 437 from executing, so no problem occurs. However, if setuptools is removed or upgraded to version 70 or higher, the script will terminate with an error on either line 434 or 437. As noted in requirements_versions.txt, the issue does not occur if setuptools==69.5.1. How about fixing it that way?

I tested it on Windows 11 and no problems occurred.

@hirorohi03
Copy link
Copy Markdown

hirorohi03 commented Mar 2, 2026

Please confirm whether the error occurs again by following the steps to reproduce it.
Alternatively, you can recognize that an error is occurring by launching the venv environment in cmd and simply executing below.

pip install 'setuptools<70'

Of course, you can simply use double quotes instead of single quotes and run pip install “setuptools<70” without any issues.

Steps to reproduce the problem

  1. Perform a clean installation using git clone and webui-user.bat.
  2. Run pip uninstall setuptools.
  3. Launch using webui-user.bat.

Console logs

venv "c:\a1111\venv\Scripts\Python.exe"
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: v1.10.1-94-g76759a18
Commit hash: 76759a185362c1dcaed4fc90303d4cfbaa2d1f02
Installing setuptools
Traceback (most recent call last):
  File "c:\a1111\modules\launch_utils.py", line 432, in ensure_build_dependencies
    setuptools_version = run(f'"{python}" -c "import setuptools; print(setuptools.__version__)"', None, None).strip()
  File "c:\a1111\modules\launch_utils.py", line 114, in run
    raise RuntimeError("\n".join(error_bits))
RuntimeError: Error running command.
Command: "c:\a1111\venv\Scripts\python.exe" -c "import setuptools; print(setuptools.__version__)"
Error code: 1
stderr: Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'setuptools'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\a1111\launch.py", line 53, in <module>
    main()
  File "c:\a1111\launch.py", line 44, in main
    prepare_environment()
  File "c:\a1111\modules\launch_utils.py", line 439, in prepare_environment
    ensure_build_dependencies()
  File "c:\a1111\modules\launch_utils.py", line 437, in ensure_build_dependencies
    run_pip("install 'setuptools<70'", "setuptools")
  File "c:\a1111\modules\launch_utils.py", line 142, in run_pip
    return run(f'"{python}" -m pip {command} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}", live=live)
  File "c:\a1111\modules\launch_utils.py", line 114, in run
    raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't install setuptools.
Command: "c:\a1111\venv\Scripts\python.exe" -m pip install 'setuptools<70' --prefer-binary
Error code: 1

@WhizZest
Copy link
Copy Markdown
Author

WhizZest commented Mar 2, 2026

@hirorohi03 Okay, I know why. cmd supports double quotes but not single quotes, while PowerShell supports both. I was testing in PowerShell before, so I didn't encounter the problem.

In that case, I'll fix it by changing setuptools==69.5.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants