anomalyco/sst · error

no package archive found for %s (tried patterns: %s-*.whl, %

Error message

no package archive found for %s (tried patterns: %s-*.whl, %s-*.tar.gz, %s-*.whl, %s-*.tar.gz)

What it means

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.

Source

Thrown at pkg/runtime/python/build.go:295

		filepath.Join(outputDir, pkg.Name+"-*.whl"),
		filepath.Join(outputDir, pkg.Name+"-*.tar.gz"),
	}

	var files []string
	var err error

	for _, pattern := range patterns {
		files, err = filepath.Glob(pattern)
		if err != nil {
			return fmt.Errorf("failed to find package archive: %w", err)
		}
		if len(files) > 0 {
			break
		}
	}

	if len(files) == 0 {
		return fmt.Errorf("no package archive found for %s (tried patterns: %s-*.whl, %s-*.tar.gz, %s-*.whl, %s-*.tar.gz)",
			pkg.Name, normalizedName, normalizedName, pkg.Name, pkg.Name)
	}

	// Process each archive file
	for _, archiveFile := range files {
		if err := processPackageArchive(archiveFile, outputDir); err != nil {
			return fmt.Errorf("failed to process archive %s: %w", archiveFile, err)
		}
	}

	return nil
}

// processPackageArchive extracts and cleans up a single package archive
func processPackageArchive(archiveFile, outputDir string) error {
	if strings.HasSuffix(archiveFile, ".whl") {
		if err := extractZip(archiveFile, outputDir); err != nil {
			return fmt.Errorf("failed to extract wheel: %w", err)

View on GitHub (pinned to a0bd20f762)

Solutions

  1. Check the package name in `install` for typos and verify it exists on PyPI
  2. Run `pip download <name> -d <buildDir>` manually to see the actual archive filename produced
  3. Confirm pip actually ran successfully in the earlier build step (look for earlier errors)
  4. Update sst if the package uses an unusual name normalization (e.g. mixed case) — newer versions may handle it

Example fix

// before
install: ["My-Package"] // archive saved as my_package-*.whl, not matched
// after
install: ["my-package"] // normalized name matches my-package-*.whl
Defensive patterns

Strategy: validation

Validate before calling

import { execSync } from "child_process";
for (const name of install) {
  try { execSync(`pip index versions ${name}`, { stdio: "ignore" }); }
  catch { throw new Error(`Package '${name}' not found on the index — check spelling`); }
}

Try / catch

try {
  await buildPackage(...);
} catch (e) {
  if (String(e).includes("no package archive found")) {
    console.error("Check the install names and that pip ran successfully:", e);
  }
  throw e;
}

Prevention

When it happens

Trigger: `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.

Common situations: 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.

Related errors


AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30). Data as JSON: /api/errors/6b39940f84abaca1. Report an issue: GitHub.