Skip to content
Latchkey

Azure Pipelines UseDotNet/UsePythonVersion "version spec did not match"

A tool-installer task could not satisfy the version you asked for. UsePythonVersion only selects versions already on the image, and UseDotNet may fail to download a spec that does not exist or is unreachable.

What this error means

A UsePythonVersion or UseDotNet step fails with Version spec X for architecture Y did not match any version or is not installed on this agent.

Azure DevOps
##[error]Version spec 3.13 for architecture x64 did not match any version in
Agent.ToolsDirectory.
##[error]Python version 3.13 not found.

Common causes

The version is not preinstalled on the image

UsePythonVersion picks from versions already in the tool cache; a version not on the hosted image is not found.

A wrong or unavailable version spec

A typo, an unreleased version, or a missing architecture variant means no matching runtime can be selected or downloaded.

How to fix it

Request a version the image provides

Pick a version listed for the hosted image, or allow a range so a present minor version matches.

azure-pipelines.yml
- task: UsePythonVersion@0
  inputs:
    versionSpec: '3.12'
    architecture: 'x64'

Let UseDotNet acquire a valid SDK

For .NET, UseDotNet can download the SDK; confirm the version exists in a release channel before pinning it.

azure-pipelines.yml
- task: UseDotNet@2
  inputs:
    packageType: 'sdk'
    version: '8.0.x'

How to prevent it

  • Check the hosted image software list for available runtime versions.
  • Use ranges (3.12, 8.0.x) rather than exact unverified patch versions.
  • Confirm the architecture variant exists for the version you pin.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →