setup-python: Version 3.10 with arch x64 not found

Description: Version 3.10 with arch x64 is not found when running on self-hosted runner.

Action version: latest

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

3.10, altough it seems like all versions are affected

Repro steps:
A description with steps to reproduce the issue. If your have a public example or repo to share, please provide the link.

- name: Set up Python 3.10
        uses: actions/setup-python@v3
        with:
          python-version: "3.10"
          cache: "pip"

Expected behavior: Version should be fetched correctly.

Actual behavior: The 3.10 version for x64 exists but the error says otherwise.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 18 (9 by maintainers)

Commits related to this issue

Most upvoted comments

This is currently failing with Python3.10 and trying to use the latest ubuntu version (which I’m reading is 22.04) from Github-hosted runners. Tried the following: …

jobs:
  deploy:
    name: deploy
    runs-on: ubuntu-latest
    steps:
      - name: Setup Python 3.10
        uses: actions/setup-python@v4
        with:
          python-version: 3.10

Error:

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

The solution is to quote 3.10, i.e.

       - name: Setup Python 3.10
         uses: actions/setup-python@v4
         with:
           python-version: "3.10"

otherwise it gets interpreted as a floating point number, and 3.10 (or 3.100, for that matter) becomes 3.1.

Answering a few months later, because I had the same issue and searching on google for "Version 3.1 was not found in the local cache" has the above post as the first link in the results.

@deepankur797

The step works without problem on Ubuntu 20.04

      - name: Set up Python 3.10
        uses: actions/setup-python@v3
        with:
          python-version: "3.10"
          architecture: "x64"
        env:
          AGENT_TOOLSDIRECTORY: /opt/hostedtoolcache

Can you please confirm you created opt/hostedtoolcache folder and grant the write permission to the user of the runner on this folder?

@BlueskyFR @TechDawg270

It is confirmed the problem relates to Debian boosters

Succees on Ubuntu-20 Fail on Debian 10.12

We need a bit more time to investigate the problem with the specific distro

I am still experiencing the issue. Tried both with the env var mentioned above, and also without

- uses: actions/setup-python@v3
        with:
          python-version: '3.10'
          architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
        env:
          AGENT_TOOLSDIRECTORY: /opt/hostedtoolcache

why is this issue closed? It is still not supported for debian even when python versions are available

This is currently failing with Python3.10 and trying to use the latest ubuntu version (which I’m reading is 22.04) from Github-hosted runners. Tried the following:

With v3:

jobs:
  deploy:
    name: deploy
    runs-on: ubuntu-latest
    steps:
      - name: Setup Python 3.10
        uses: actions/setup-python@v3
        with:
          python-version: 3.10

Error:

Version 3.1 was not found in the local cache
Error: Version 3.1 with arch x[6](repo_url)4 not found
The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

With v4:

jobs:
  deploy:
    name: deploy
    runs-on: ubuntu-latest
    steps:
      - name: Setup Python 3.10
        uses: actions/setup-python@v4
        with:
          python-version: 3.10

Error:

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

Edit:

Fixed by using ubuntu-20.04 and specifying my full python version, “3.10.12” instead of “3.10”

@BlueskyFR @TechDawg270

The short story: Debian is not supported, sorry

The only workaround is - either to use Ubuntu for self-hosted machine (any virtualisation works fine) or to install python from the Debian specific repositories.

Long story: The exact reason is the parsing /etc/os-release and extracting VERSION_ID: while we expect one of “18.04”, “20.04” or “22.04” the debian provides “10” and there’s no python matched to this version id.

The worst part is we hardly can fix the code because the python from tool cache is built against the libraries specific to the distribution and there’s no certainty that the python will work the libraries from the other distribution.

Hello @BlueskyFR i am going to close this issue because it seems to be resolved and there’s no other comments so far. Feel free to open new issue or reopen this one in case of any problem

@dsame thanks for the help it is working now. It was an issue created by some misconfig in the .actrc file as it was using the wrong image. It was overriding the ubuntu image using -P flag.

@dsame For me it is failing even on Ubuntu-20.04

Description: Version 3.10 with arch x64 is not found when running on act locally.

Action version: latest

Platform:

  • Ubuntu

Runner type:

  • Locally

Tools version:

3.10, although it seems like all versions are affected

Repro steps: A description with steps to reproduce the issue. If your have a public example or repo to share, please provide the link.

- name: setup python uses: actions/setup-python@v3.1.2 with: python-version: "3.x" cache: "pip" env: AGENT_TOOLSDIRECTORY: /opt/hostedtoolcache

Expected behaviour: The version should be fetched correctly.

Actual behaviour: The 3.10 version for x64 exists but the error says otherwise.