Lesstep
GitHub Actions・2026年11月3日に確認

GitHub Actions:setup-python の「The version ... with architecture 'x64' was not found」

actions/setup-python は、ランナーの OS のバージョンとプロセッサーに合わせて作られた、できあがりの Python を入れます。まずランナーのツールキャッシュを見て、次に GitHub が actions/python-versions で公開しているビルドの一覧を見ます。Python をコンパイルしたり、ほかから取ってきたりはしないので、どちらにも頼んだバージョンが無ければ、そのステップは失敗します(「そのアーキテクチャーのバージョンが見つからない」)。

見え方

2026年10月29日、ubuntu-26.04 の公開の実行で、python-version: 3.9 を頼んだときです:

Version 3.9 was not found in the local cache
##[error]The version '3.9' with architecture 'x64' was not found for Ubuntu 26.04.
The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

ランナーごとにあるバージョン

2026年11月3日の versions-manifest.json からです:

つまり 3.10・3.11・3.12 には、Ubuntu 26.04 と Windows の両方にあるパッチリリースが1つもありません。マトリックスのすべてで 3.12.10 に固定すると Ubuntu 26.04 で失敗し、3.12.13 に固定すると Windows と macOS で失敗します。

ランナーごとの一覧は自分でも出せます(platform は linux・darwin・win32、arch は x64 か arm64。macOS と Windows には platform_version がありません):

gh api repos/actions/python-versions/contents/versions-manifest.json \
  -H "Accept: application/vnd.github.raw+json" \
  --jq '.[] | .version as $v | .files[]
        | select(.platform == "linux" and .platform_version == "26.04" and .arch == "x64")
        | $v'

マイナーバージョンで頼む

"3.12.8" でなく "3.12" と書きます(blueprintx #945)。setup-python は、ランナーごとに 3.12 のいちばん新しいビルドを入れます。python-version を書いていないときに setup-python が読む .python-version のファイルも同じです。

- uses: actions/setup-python@v7
  with:
    python-version: "3.12"

引用符は付けたままにします。引用符が無いと YAML は 3.10 を数の 3.1 と読み、エラーには '3.1' と出ます(kg-microbe #1056)。

古いバージョンは、それがあるランナーで動かす

Python 3.8 と 3.9 は ubuntu-24.04 に、3.7 は ubuntu-22.04 と、macos-15-intel などの Intel の Mac のイメージにビルドがあります。ある公開のプロジェクトのマトリックスは、いまちょうどそうなっています(EliahKagan/version #40)。古いバージョンが1つだけなら、runs-on の式で足ります:

strategy:
  matrix:
    python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
runs-on: ${{ matrix.python-version == '3.9' && 'ubuntu-24.04' || 'ubuntu-latest' }}

uv で入れる

uv は自分の Python のビルドをダウンロードし、そのビルドは Ubuntu のリリースに縛られません。一覧には、x64 の Linux・macOS・Windows 向けに 3.8.20 までの 3.8 と 3.9.25 までの 3.9 があり、3.7 はありません。11月1日、ubuntu-26.04 の公開のジョブがこの方法で 3.8 を入れ、cpython-3.8.20-linux-x86_64-gnu をダウンロードしていました(pyrs-yaml #696)。

- uses: astral-sh/setup-uv@v10.3.3
  with:
    python-version: "3.9"
    activate-environment: true
- run: uv pip install -r requirements.txt
- run: python -m pytest

uv が作る環境には pip が無いので、pip install でなく uv pip install で入れます。

見分け方

失敗したジョブを IntelliJ IDEA から見るなら

Pipeline Inbox for GitHub Actions Workflows は、Lesstep が作っている JetBrains IDE(2024.1 以降)のプラグインです。すべてのリポジトリの実行を、ジョブ・ステップと一緒に IDE のツールウィンドウに並べるので、マトリックスのうちセットアップで落ちた1本が目立ちます。いまのブランチの実行はステータスバーに出ます。読むのは無料、失敗したジョブの再実行・キャンセル・ワークフローの実行・デプロイのレビューは Pro(月 US$1.50・30日の無料試用つき)です。

GitHub と GitHub Actions は GitHub, Inc. の商標、IntelliJ IDEA は JetBrains s.r.o. の商標、Python は Python Software Foundation の登録商標です。このページは GitHub, Inc.・JetBrains・Python Software Foundation のいずれとも提携しておらず、承認も受けていません。

ほかに:ubuntu-latest の Ubuntu 26.04 への移行 · 「Unable to resolve action」 · 「Node.js 20 is deprecated」の警告 · IntelliJ IDEA で使える GitHub Actions のプラグインの比較 · English