From afb929271c4e7b0670e29e91346b0ca48cb3d04d Mon Sep 17 00:00:00 2001 From: Roland Tannous Date: Thu, 2 Apr 2026 15:49:39 +0000 Subject: [PATCH] fix: pass --clear to uv venv to handle leftover venv directory When re-running install.sh, the existing venv is rm -rf'd only if bin/python is executable. If the directory exists but is broken or partial, the rm guard is skipped and uv venv fails with exit code 2: "A directory already exists at: .unsloth/studio/unsloth_studio". Adding --clear lets uv replace any existing directory at the path, fixing re-installs without requiring user intervention. --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 2d9a368555..b6a19d9e53 100755 --- a/install.sh +++ b/install.sh @@ -927,7 +927,7 @@ fi if [ ! -x "$VENV_DIR/bin/python" ]; then step "venv" "creating Python ${PYTHON_VERSION} virtual environment" substep "$VENV_DIR" - run_install_cmd "create venv" uv venv "$VENV_DIR" --python "$PYTHON_VERSION" + run_install_cmd "create venv" uv venv "$VENV_DIR" --python "$PYTHON_VERSION" --clear fi # Guard against Python 3.13.8 torch import bug on Apple Silicon