{"record":{"id":"6b39940f84abaca1","repo":"anomalyco/sst","slug":"no-package-archive-found-for-s-tried-patterns","errorCode":null,"errorMessage":"no package archive found for %s (tried patterns: %s-*.whl, %s-*.tar.gz, %s-*.whl, %s-*.tar.gz)","messagePattern":"no package archive found for (.+?) \\(tried patterns: (.+?)-\\*\\.whl, (.+?)-\\*\\.tar\\.gz, (.+?)-\\*\\.whl, (.+?)-\\*\\.tar\\.gz\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runtime/python/build.go","lineNumber":295,"sourceCode":"\t\tfilepath.Join(outputDir, pkg.Name+\"-*.whl\"),\n\t\tfilepath.Join(outputDir, pkg.Name+\"-*.tar.gz\"),\n\t}\n\n\tvar files []string\n\tvar err error\n\n\tfor _, pattern := range patterns {\n\t\tfiles, err = filepath.Glob(pattern)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to find package archive: %w\", err)\n\t\t}\n\t\tif len(files) > 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif len(files) == 0 {\n\t\treturn fmt.Errorf(\"no package archive found for %s (tried patterns: %s-*.whl, %s-*.tar.gz, %s-*.whl, %s-*.tar.gz)\",\n\t\t\tpkg.Name, normalizedName, normalizedName, pkg.Name, pkg.Name)\n\t}\n\n\t// Process each archive file\n\tfor _, archiveFile := range files {\n\t\tif err := processPackageArchive(archiveFile, outputDir); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to process archive %s: %w\", archiveFile, err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// processPackageArchive extracts and cleans up a single package archive\nfunc processPackageArchive(archiveFile, outputDir string) error {\n\tif strings.HasSuffix(archiveFile, \".whl\") {\n\t\tif err := extractZip(archiveFile, outputDir); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to extract wheel: %w\", err)","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/pkg/runtime/python/build.go#L277-L313","documentation":"After trying several glob patterns (`normalizedName-*.whl`, `normalizedName-*.tar.gz`, and the same for `pkg.Name`), no package archive was found in the build output directory. This means pip never produced an artifact matching the package name, so extraction cannot proceed.","triggerScenarios":"`buildPackage` runs for a Python function and the patterns `%s-*.whl` / `%s-*.tar.gz` match nothing because pip failed, the package name is misspelled, or the downloaded file name normalization differs from the expected name.","commonSituations":"Typo in the `install` package name; package published with a normalized name (dashes→underscores, lowercase) that the normalizer did not anticipate; pip resolved a dependency as a wheel with a different case; network/proxy caused pip to skip the package silently.","solutions":["Check the package name in `install` for typos and verify it exists on PyPI","Run `pip download <name> -d <buildDir>` manually to see the actual archive filename produced","Confirm pip actually ran successfully in the earlier build step (look for earlier errors)","Update sst if the package uses an unusual name normalization (e.g. mixed case) — newer versions may handle it"],"exampleFix":"// before\ninstall: [\"My-Package\"] // archive saved as my_package-*.whl, not matched\n// after\ninstall: [\"my-package\"] // normalized name matches my-package-*.whl","handlingStrategy":"validation","validationCode":"import { execSync } from \"child_process\";\nfor (const name of install) {\n  try { execSync(`pip index versions ${name}`, { stdio: \"ignore\" }); }\n  catch { throw new Error(`Package '${name}' not found on the index — check spelling`); }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await buildPackage(...);\n} catch (e) {\n  if (String(e).includes(\"no package archive found\")) {\n    console.error(\"Check the install names and that pip ran successfully:\", e);\n  }\n  throw e;\n}","preventionTips":["Verify each `install` entry exists on PyPI before deploying","Use lowercase normalized package names in config","Confirm the pip install step succeeded in build logs before extraction","Prefer wheels with predictable normalized filenames"],"tags":["python","pip","package-install","glob"],"backgroundTag":"package-archive-not-found","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}