anomalyco/sst · error
failed to run uv pip install: %v %s Function: %s Handler: %
Error message
failed to run uv pip install: %v %s Function: %s Handler: %s Working directory: %s Pyproject path: %s
What it means
When the `uv pip install` subprocess exits non-zero, SST logs the full command, output, function ID, handler, working dir, and pyproject path, wipes the partial dependency cache, and returns this error embedding uv's stderr/stdout. It wraps any concrete uv failure — resolver conflicts, nonexistent versions, missing wheels for the target platform, bad pyproject/requirements syntax, or index auth failures.
Source
Thrown at pkg/runtime/python/build.go:986
if cacheKey != "" {
os.RemoveAll(depsCacheDir)
}
return fmt.Errorf("uv pip install timed out after 15 minutes - check network connectivity and try again")
}
if err != nil {
slog.Error("uv pip install failed",
"command", strings.Join(installCmd.Args, " "),
"error", err,
"output", string(installOutput),
"functionID", input.FunctionID,
"handler", input.Handler,
"workingDir", installWorkspaceDir,
"pyprojectPath", projectInfo.PyprojectPath)
if cacheKey != "" {
os.RemoveAll(depsCacheDir)
}
return fmt.Errorf("failed to run uv pip install: %v\n%s\n\nFunction: %s\nHandler: %s\nWorking directory: %s\nPyproject path: %s",
err, string(installOutput), input.FunctionID, input.Handler, installWorkspaceDir, projectInfo.PyprojectPath)
}
if err := cleanupInstalledDependencies(depsCacheDir); err != nil {
slog.Warn("failed to clean up installed dependencies", "error", err)
}
// Precompile bytecode in the cache so all functions sharing these deps benefit
if err := precompilePythonFiles(ctx, input, depsCacheDir); err != nil {
slog.Warn("failed to precompile dependencies in cache", "error", err)
}
if err := copyDependencyPackages(depsCacheDir, input.Out()); err != nil {
return fmt.Errorf("failed to copy dependencies to artifact: %w", err)
}
os.Remove(filteredRequirementsPath)
View on GitHub (pinned to a0bd20f762)
Solutions
- Read the embedded uv output in the error message — it contains the actual resolver/download failure
- Fix version pins or conflicting constraints flagged by the resolver in pyproject.toml / requirements.txt
- For missing-wheel errors, check the package publishes manylinux wheels for your target arch (arm64/x86_64) and Python version, or switch function architecture
- For 401/404 on private packages, set index credentials via UV_INDEX_* env vars or ~/.netrc
- Run `uv pip install -r requirements.txt` manually in the reported working directory to reproduce and debug interactively
Example fix
// before (pyproject.toml) [project] dependencies = ["fastapi==0.999.0"] # no such version // after [project] dependencies = ["fastapi>=0.115"]
Defensive patterns
Strategy: validation
Validate before calling
# validate requirements resolve before deploying uv pip compile pyproject.toml -o /tmp/reqs.txt --quiet && echo "deps resolve OK" # or dry-run install uv pip install --dry-run -r requirements.txt
Prevention
- Run `uv pip compile`/`--dry-run` locally against the same pins before deploying
- Use a lockfile (uv.lock / pinned requirements) to prevent surprise resolution conflicts
- Confirm target-platform wheels exist: manylinux for arm64/x86_64 at your Python version
- Keep private-index auth in env vars, never interactive
When it happens
Trigger: Specifically: installCmd.CombinedOutput() (build.go:952) returns err != nil; the select takes the resultChan branch and copySyncedDependencies returns fmt.Errorf with the uv output plus Function/Handler/WorkingDirectory/PyprojectPath context.
Common situations: Pin like `boto3==9.9.9` that doesn't exist; a dependency with no manylinux wheel for arm64/x86_64 or the target Python version; conflicting version constraints in pyproject.toml; typo in a private package name or missing index credentials (401/404); invalid requirements.txt syntax.
Related errors
- %s
- failed to install dependencies: %w
- failed to copy synced dependencies: %w
- uv pip install timed out after 15 minutes - check network co
- failed to copy dependencies to artifact: %w
AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30).
Data as JSON: /api/errors/7eb532f1860191da.
Report an issue: GitHub.