GitHub actions setup-python stopped working

Question:

Below is my workflow file, which worked previously forever and I’ve not changed anything.

env:
  PYTHON_VERSION: '3.8.9'

jobs:
  build:
    name: build  
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-python@v3
      with:
        python-version: ${{ env.PYTHON_VERSION }}
    - run: mkdir file-icons product-icons
    - run: python3 -m translate
    - uses: actions/upload-artifact@v3
      with:
        name: build
        path: |
          file-icons/
          product-icons/
          thumbnails/
          *.md
          package.json

today it decided to stop working
Error: Version 3.8.9 with arch x64 not found
enter image description here

this is with debug logging on

##[debug]x64===x64 && linux===linux makes no sense to me, it found a match and then just moved on
enter image description here

what it was before
enter image description here

Asked By: mightbesimon

||

Answers:

Resolved. GitHub actions recently updated ubuntu-latest from 20.04 to 22.04

certain versions of python is not yet supported by setup-python action on 22.04 (and currently they are not looking to support old python versions such as 3.8.9)

Solutions:

option one – set ubuntu to 20.0.4 (the suggested option according to the runner image issue on GitHub https://github.com/actions/runner-images/issues/6399)

option two – use python 3.8.12 or newer

Answered By: mightbesimon
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.