Fix CLIP installation failures#17293
Conversation
|
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. |
|
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: Windows: linux: |
|
Thank you! your solution worked for me. |
|
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. |
I tested it on Windows 11 and no problems occurred. |
|
Please confirm whether the error occurs again by following the steps to reproduce it. pip install 'setuptools<70'Of course, you can simply use double quotes instead of single quotes and run Steps to reproduce the problem
Console logsvenv "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 |
|
@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. |
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
ensure_build_dependencies()function that checks and installs essential build tools before CLIP installation--no-build-isolationflag to avoid build environment isolation issuesIssues Fixed
This PR resolves the following reported issues:
Cannot import 'setuptools.build_meta'ModuleNotFoundError: No module named 'pkg_resources'ModuleNotFoundError: No module named 'pkg_resources'Screenshots/videos:
Checklist: