{"record":{"id":"7eb532f1860191da","repo":"anomalyco/sst","slug":"failed-to-run-uv-pip-install-v-s-function-s","errorCode":null,"errorMessage":"failed to run uv pip install: %v\n%s\n\nFunction: %s\nHandler: %s\nWorking directory: %s\nPyproject path: %s","messagePattern":"failed to run uv pip install: (.+?)\n(.+?)\n\nFunction: (.+?)\nHandler: (.+?)\nWorking directory: (.+?)\nPyproject path: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runtime/python/build.go","lineNumber":986,"sourceCode":"\t\tif cacheKey != \"\" {\n\t\t\tos.RemoveAll(depsCacheDir)\n\t\t}\n\t\treturn fmt.Errorf(\"uv pip install timed out after 15 minutes - check network connectivity and try again\")\n\t}\n\n\tif err != nil {\n\t\tslog.Error(\"uv pip install failed\",\n\t\t\t\"command\", strings.Join(installCmd.Args, \" \"),\n\t\t\t\"error\", err,\n\t\t\t\"output\", string(installOutput),\n\t\t\t\"functionID\", input.FunctionID,\n\t\t\t\"handler\", input.Handler,\n\t\t\t\"workingDir\", installWorkspaceDir,\n\t\t\t\"pyprojectPath\", projectInfo.PyprojectPath)\n\t\tif cacheKey != \"\" {\n\t\t\tos.RemoveAll(depsCacheDir)\n\t\t}\n\t\treturn fmt.Errorf(\"failed to run uv pip install: %v\\n%s\\n\\nFunction: %s\\nHandler: %s\\nWorking directory: %s\\nPyproject path: %s\",\n\t\t\terr, string(installOutput), input.FunctionID, input.Handler, installWorkspaceDir, projectInfo.PyprojectPath)\n\t}\n\n\tif err := cleanupInstalledDependencies(depsCacheDir); err != nil {\n\t\tslog.Warn(\"failed to clean up installed dependencies\", \"error\", err)\n\t}\n\n\t// Precompile bytecode in the cache so all functions sharing these deps benefit\n\tif err := precompilePythonFiles(ctx, input, depsCacheDir); err != nil {\n\t\tslog.Warn(\"failed to precompile dependencies in cache\", \"error\", err)\n\t}\n\n\tif err := copyDependencyPackages(depsCacheDir, input.Out()); err != nil {\n\t\treturn fmt.Errorf(\"failed to copy dependencies to artifact: %w\", err)\n\t}\n\n\tos.Remove(filteredRequirementsPath)\n","sourceCodeStart":968,"sourceCodeEnd":1004,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/pkg/runtime/python/build.go#L968-L1004","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before (pyproject.toml)\n[project]\ndependencies = [\"fastapi==0.999.0\"]  # no such version\n\n// after\n[project]\ndependencies = [\"fastapi>=0.115\"]","handlingStrategy":"validation","validationCode":"# validate requirements resolve before deploying\nuv pip compile pyproject.toml -o /tmp/reqs.txt --quiet && echo \"deps resolve OK\"\n# or dry-run install\nuv pip install --dry-run -r requirements.txt","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["python","uv","dependency-resolution","build","lambda"],"backgroundTag":"pip-install-failed","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}