Skip to content

Commit 6d2d3ce

Browse files
WhizZestlshqqytiger
authored andcommitted
Fix CLIP installation failures(issue#17201, AUTOMATIC1111#17284, AUTOMATIC1111#17287, Discussion AUTOMATIC1111#17283,AUTOMATIC1111#17275) (AUTOMATIC1111#17293)
1 parent 32f147b commit 6d2d3ce

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

modules/launch_utils.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,24 @@ def prepare_environment():
627627
'add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check'
628628
)
629629

630+
# Ensure build dependencies are installed before any package that might need them
631+
def ensure_build_dependencies():
632+
"""Ensure essential build tools are available"""
633+
if not is_installed("wheel"):
634+
run_pip("install wheel", "wheel")
635+
# Check setuptools version compatibility
636+
try:
637+
setuptools_version = run(f'"{python}" -c "import setuptools; print(setuptools.__version__)"', None, None).strip()
638+
if setuptools_version >= "70":
639+
run_pip("install 'setuptools<70'", "setuptools")
640+
except Exception:
641+
# If setuptools check fails, install compatible version
642+
run_pip("install 'setuptools<70'", "setuptools")
643+
# Install build dependencies early
644+
ensure_build_dependencies()
645+
630646
if not is_installed("clip"):
631-
run_pip(f"install {clip_package}", "clip")
647+
run_pip(f"install --no-build-isolation {clip_package}", "clip")
632648
startup_timer.record("install clip")
633649

634650
if not is_installed("open_clip"):

0 commit comments

Comments
 (0)