Lesstep
Azure Pipelines · Python · Checked November 7, 2026

Azure Pipelines: "Version spec ... did not match any version in Agent.ToolsDirectory"

The Use Python version task, UsePythonVersion@0, does not install Python from python.org. It looks in the agent's tool cache, the folder in Agent.ToolsDirectory, and if the version is missing it tries to download a build from the GitHub Actions python-versions registry into that cache. This error comes when the version was neither in the cache nor downloaded.

When the failing build is a pull request's build validation, the pull request waits on it: Azure DevOps Pull Requests, a plugin for JetBrains IDEs, lists the pull request's branch policies with their state in PyCharm or IntelliJ IDEA, and with Pro runs a failed build policy again once the fix is pushed. Get it on JetBrains Marketplace

What it looks like

What the task does

On Microsoft-hosted agents

- task: UsePythonVersion@0
  inputs:
    versionSpec: '3.12'
    githubToken: $(GITHUB_TOKEN)

On a self-hosted agent

Azure DevOps pull requests in PyCharm and IntelliJ IDEA

Azure DevOps Pull Requests, a plugin by Lesstep for JetBrains IDEs 2024.1 or later and Android Studio, reads the organization, project and repository from your git remote and lists the pull requests that wait for your review in an IDE tool window, on Azure DevOps Services and on Azure DevOps Server. It shows the branch policies of a pull request with their state, so a required build that has not passed is next to its pull request, and with Pro you run a failed or expired build policy again from there. The review inbox is free; voting, commenting, completing and creating are Pro, with a 30-day trial.

Get it on JetBrains Marketplace

Azure DevOps and Azure Pipelines are trademarks of Microsoft Corporation; GitHub is a trademark of GitHub, Inc.; Python is a trademark of the Python Software Foundation; PyCharm and IntelliJ IDEA are trademarks of JetBrains s.r.o. This page is not affiliated with or endorsed by Microsoft, GitHub, the Python Software Foundation or JetBrains.

More: pip 401 from Azure Artifacts · No space left on device on a hosted agent · Azure DevOps pull requests in PyCharm · 日本語