From 28a02ec303698589b1982452fc791ce7ee336290 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 2 Jun 2026 23:56:54 -0700 Subject: [PATCH] install.ps1: self-heal deps as bare names (fix PS->wsl quote mangling) The server-deps self-heal passed specs like "structlog>=24.1.0" with embedded double-quotes through PowerShell -> wsl.exe -> bash -lc; PowerShell's native-arg quoting drops the quotes, so bash parsed >= as a redirection and the whole install failed ('could not auto-install Studio server deps'). Use bare package names (uv resolves latest, satisfying the studio.txt minimums) -> no embedded quotes, no redirection. Verified: bare-name uv install populates fastapi/uvicorn/structlog/... and Studio starts (HTTP 200). Co-Authored-By: Claude Opus 4.8 --- install.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/install.ps1 b/install.ps1 index e30d8c29fc..81bff7e45e 100644 --- a/install.ps1 +++ b/install.ps1 @@ -1571,7 +1571,13 @@ shell.Run cmd, 0, False substep "Studio web-server deps incomplete (install.sh step cut short) -- installing them now..." "Cyan" # Mirrors studio/backend/requirements/studio.txt MINUS the huggingface-hub # pin (protected above). Prefer uv (matches install.sh); fall back to pip. - $_deps = 'typer fastapi uvicorn matplotlib pandas nest_asyncio pyjwt easydict addict "structlog>=24.1.0" diceware ddgs "cryptography>=42.0.0" "httpx>=0.27.0" "fastmcp>=3.0.2"' + # Bare package names only -- NO version specifiers / embedded quotes. + # The whole repair string is passed PowerShell -> wsl.exe -> bash -lc, and + # PowerShell's native-arg quoting mangles embedded double-quotes, so a + # "structlog>=24.1.0" loses its quotes and bash parses `>=` as a redirection, + # failing the whole install. uv resolves the latest of each (which satisfies + # the studio.txt minimums anyway), so bare names are sufficient and safe. + $_deps = 'typer fastapi uvicorn matplotlib pandas nest_asyncio pyjwt easydict addict structlog diceware ddgs cryptography httpx fastmcp' $_repair = 'PY=/root/.unsloth/studio/unsloth_studio/bin/python; UV="$(command -v uv 2>/dev/null || echo /root/.local/bin/uv)"; if [ -x "$UV" ] || command -v uv >/dev/null 2>&1; then "$UV" pip install --python "$PY" ' + $_deps + '; else "$PY" -m pip install ' + $_deps + '; fi' $prevEapR = $ErrorActionPreference; $ErrorActionPreference = "Continue" try { & wsl.exe -d $distro -u root -- bash -lc $_repair } catch {} finally { $ErrorActionPreference = $prevEapR }