SAM Doctor

ERROR REFERENCE

PythonPipBuilder:ResolveDependencies failed

sam build asked pip to resolve the function's requirements and pip could not — a pinned version that does not exist for the target runtime, a package needing a newer Python, or an index the build environment cannot reach.

WHAT IT MEANS

What this error means

ERROR: Could not find a version that satisfies the requirement ... (from versions: none) is pip speaking through SAM's builder. "From versions: none" usually means no release of that package matches the constraint for the Python version SAM is building against — which may be older than the one on your laptop. Private-index packages produce the same wording when the index is not configured in the build environment.

FIX

How to fix it

  1. Reproduce with plain pip against the function runtime:
    python3.12 -m pip install -r hello_world/requirements.txt --dry-run
    Use the same minor version as the function's Runtime: property; that mismatch is the most common cause.
  2. Check the pinned version exists on PyPI for that Python version — yanked releases and typos in version pins both end here.
  3. For private indexes, make the index available to the build: a pip.conf/PIP_INDEX_URL the builder can see, and for --use-container builds, one that is reachable from inside the container.
  4. Align local and CI Python versions so the failure reproduces where you can debug it.

AUTOMATE THE TRIAGE

Diagnose this automatically

SAM Doctor recognizes the resolver failure (high confidence) and keeps it distinct from binary-validation and runtime-mismatch failures in the same build family. Runs locally; no AWS access, no log upload.

python -m pip install sam-doctor
sam-doctor diagnose build.log --format markdown

RELATED