setup-python: Error: Version X with arch x64 not found
Describe the bug
I am attempting to use setup-python with a self-hosted runner running on an ec2 instance. I am using this ami ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20201112
. I have followed the instructions here. I am getting the following output when the setup-python action is run:
Run actions/setup-python@v2
with:
python-version: 3.7.7
token: ***
env:
AGENT_TOOLSDIRECTORY: /opt/hostedtoolcache
Version 3.7.7 was not found in the local cache
Version 3.7.7 is available for downloading
Download from "https://github.com/actions/python-versions/releases/download/3.7.7-20200609.4/python-3.7.7-linux-18.04-x64.tar.gz"
Extract downloaded archive
/bin/tar xz --warning=no-unknown-keyword -C /actions-runner/_work/_temp/f7f341f3-b2b9-4eff-bff0-5b55acb3a0f1 -f /actions-runner/_work/_temp/402c2129-71c1-46e4-9263-3b04a4b9772a
Execute installation script
Check if Python hostedtoolcache folder exist...
Create Python 3.7.7 folder
Copy Python binaries to hostedtoolcache folder
Create additional symlinks (Required for the UsePythonVersion Azure Pipelines task and the setup-python GitHub Action)
Upgrading PIP...
Looking in links: /tmp/tmpryj40n3d
Requirement already satisfied: setuptools in /opt/hostedtoolcache/Python/3.7.7/x64/lib/python3.7/site-packages (41.2.0)
Requirement already satisfied: pip in /opt/hostedtoolcache/Python/3.7.7/x64/lib/python3.7/site-packages (19.2.3)
Collecting pip
Using cached https://files.pythonhosted.org/packages/cb/28/91f26bd088ce8e22169032100d4260614fc3da435025ff389ef1d396a433/pip-20.2.4-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-20.2.4
Create complete file
Error: Version 3.7.7 with arch x64 not found
The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
It’s unclear what is actually failing as it seems to be finding the 3.7.7 python version and installs it and then it fails after installing pip.
Which version of the action are you using?
-
v1
-
v2
- Some other tag (such as
v2.0.1
ormaster
)
Environment
- self-hosted
- Linux
- Windows
- Mac
If applicable, please specify if you’re using a container
Python Versions
Please list all of the effected versions of Python (3.8.2
, etc.)
Tried 3.7.7, 3.10.0-alpha.2
To Reproduce Steps to reproduce the behavior:
- Go to ‘…’
- Click on ‘…’
- Scroll down to ‘…’
- See error
Run/Repo Url If applicable, and if your repo/run is public, please include a URL so it is easier for us to investigate. NA
Screenshots
Additional context Here’s the script that launches the runner:
#!/bin/bash -xe
apt-get update -y
apt-get upgrade -y
${local.apt-get-all-packages}
sudo usermod -a -G docker ubuntu
sudo systemctl start docker
sudo systemctl enable docker
export RUNNER_ALLOW_RUNASROOT=true
export AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
mkdir actions-runner
mkdir /opt/hostedtoolcache
cd actions-runner
curl -O -L https://github.com/actions/runner/releases/download/v${var.runner-version}/actions-runner-linux-x64-${var.runner-version}.tar.gz
tar xzf ./actions-runner-linux-x64-${var.runner-version}.tar.gz
./config.sh --url https://github.com/${var.owner}/${var.repository} --token ${var.github-registration-token} --name "actions-runner-$(hostname)" --unattended
sudo ./svc.sh install
sudo ./svc.sh start
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 50
- Comments: 72 (6 by maintainers)
Commits related to this issue
- remove python3.6 test/lint support due to https://github.com/actions/setup-python/issues/162 — committed to sandialabs/pvOps by MichaelHopwood 3 years ago
- https://github.com/actions/setup-python/issues/162#issuecomment-750033576 https://github.com/actions/setup-python/issues/162#issuecomment-750033576 — committed to jmbayu/python_word_gen by jmbayu 2 years ago
- Update lint.yaml Changed ubuntu version because of https://github.com/actions/setup-python/issues/162#issuecomment-1324030132 — committed to populationgenomics/sv-workflows by hopedisastro 2 years ago
- Update lint.yaml (#53) * Update lint.yaml Changed ubuntu version because of https://github.com/actions/setup-python/issues/162#issuecomment-1324030132 * Update str_iterative_eh_runner.py * U... — committed to populationgenomics/sv-workflows by hopedisastro 2 years ago
- Change runner ubuntu version to fix GitHub error See also: https://github.com/actions/setup-python/issues/162#issuecomment-1325307787 — committed to MozillaFoundation/foundation.mozilla.org by tbrlpld 2 years ago
- chore(ci): workaround python not found on github runners - seems related to : https://github.com/actions/setup-python/issues/162 - a fix is to use ubuntu 20.04, and we don't NEED latest for anythin... — committed to justindujardin/pathy by justindujardin 2 years ago
- Try to temp fix build issue https://github.com/actions/setup-python/issues/162 — committed to aspose-barcode-cloud/aspose-barcode-cloud-python by deleted user 2 years ago
- Release 22.11 (#48) * Add MaxiCodeMode class *Add :param mode: :type: MaxiCodeMode to MaxiCodeParams *Delete :param encode_mode: :type: int MaxiCodeParams * Try to temp fix build issue http... — committed to aspose-barcode-cloud/aspose-barcode-cloud-python by ivankamkin 2 years ago
- Change ubuntu-latest to ubuntu-20.04. (Bug: https://github.com/actions/setup-python/issues/162) — committed to dpwinter/qsample by dpwinter 2 years ago
- build: Correct "Version 3.6 with arch x64 not found" actions/setup-python#162 — committed to open-contracting/deploy by jpmckinney 2 years ago
- build: Correct "Version 3.6 with arch x64 not found" actions/setup-python#162 — committed to open-contracting/deploy by jpmckinney 2 years ago
- Fix python-package.yml as https://github.com/actions/setup-python/issues/162#issuecomment-1325307787 — committed to SebastienEveno/exotx by SebastienEveno 2 years ago
- change the ubuntu version for the CI because of this issue: https://github.com/actions/setup-python/issues/162 — committed to joshspeagle/dynesty by segasai 2 years ago
- fix: worflow failures due to updated ubuntu See: https://github.com/actions/setup-python/issues/162 for information on why this is necessary. Working on fixing this by pinning ubuntu version — committed to Calder-Ty/realreq by Calder-Ty 2 years ago
- fix: worflow failures due to updated ubuntu See: https://github.com/actions/setup-python/issues/162 for information on why this is necessary. Working on fixing this by pinning ubuntu version — committed to Calder-Ty/realreq by Calder-Ty 2 years ago
- Fix python setup issue https://github.com/actions/setup-python/issues/162#issuecomment-1325307787 — committed to ykerus/crea-scraper by ykerus 2 years ago
- Fix Python Setup failure in GitHub Actions https://github.com/actions/setup-python/issues/162 — committed to Rat-Rig/V-core-3 by nexx 2 years ago
- Fix Python Setup failure in GitHub Actions https://github.com/actions/setup-python/issues/162 — committed to Rat-Rig/V-Minion by nexx 2 years ago
- Fix Python Setup failure in GitHub Actions https://github.com/actions/setup-python/issues/162 — committed to Rat-Rig/lab.ratrig.com by nexx 2 years ago
- used previous version of Ubuntu due to problems fetching Python https://github.com/actions/setup-python/issues/162 — committed to boostorg/boost_unordered_benchmarks by joaquintides 2 years ago
Any chance this issue get attention?
For me the same. I use https://github.com/nektos/act for testing Github actions locally.
I got
and even tried the one from the README
Looks like the latest ubuntu version has some issue, sticking to 20.04 resolved this issue.
From:
To:
Tried changing the
actions/setup-python@v1
toactions/setup-python@v2
? I just did and it worked for me somehow. In my case it was 3.9.9 arch 64 missing.This issue does not seem to be resolved with local testing with act running on a MacOS M1 chip machine. The actions is set as follows:
The command to reproduce the issue is
Sorry to reopen but this is happening to me now with
setup-python@v4
. Tried a matrix with all python version >3.9 and they all had the same error. The manifest of python versions also shows the target versions with the same arch but is returning an error. Have tried the workarounds in this issue with no luck 😕self-hosted linux x64
Here’s a screenshot:
@kldavis4 I’m using Amazon Linux 2 AMI. That’s probably the issue. The
platform_version
in the manifest seems to be exclusive to Ubuntu with no way to override it.Unrelated to the problem of the author, but I initially thought I had the same problem: I used debian instead of ubuntu, thus it did not work.
Mabye helpful for other stumbling over this
I’m not sure why this is closed. Indeed (based on the last few comments) it does not appear to be fixed.
As per https://github.com/actions/setup-python/issues/541#issuecomment-1314296872 it appears that (at least for me) the following workaround works:
ubuntu-20.04
instead ofubuntu-latest
.However it seems to me that to be considered “fixed” it should work with
ubuntu-latest
as well.Am I missing something?
@dsame Please re-open, or please explain why this is considered resolved? Maybe I am missing something? Thank you.
@meiswjn You can use Debian with creating
/etc/lsb-release
like Ubuntu. If you use Debian 10,/etc/lsb-release
should be same as Ubuntu 18.04 like this.The root of this issue seems to be that the tool-cache library function for fetching the cache directory (https://github.com/actions/toolkit/blob/master/packages/tool-cache/src/tool-cache.ts#L693) is using
RUNNER_TOOL_CACHE
but this is set to/actions-runner/_work/_tool
instead of/opt/hostedtoolcache
. SettingRUNNER_TOOL_CACHE
(within the self-hosted runner or the actions yml) seems to have no effect and I haven’t been able to determine yet how the default is getting set.In my case I was doing something stupid. Maybe this will help someone.
3.10
is just a number in yaml and gets interpreted as version3.1
. Changed it to"3.10"
and it worked (withubuntu-latest
).Same too. Looks like latest was updated from 20.04.5 to 22.04.1.
another poke in the wall…
Didn’t see someone mentioning it was bad practice. Perhaps I read past it, but at the end of the day I can see why. Thanks for mentioning this!
In addition the comment made by abarragan-adtriba was very helpful.
In my case, wanting Python 3.11.1, I should use
ubuntu-22.04
instead. Again, thanks for pointing this out!@fan9704 , your issue is already explained in the thread, in particular: https://github.com/actions/setup-python/issues/162#issuecomment-1344117224
I am having the same error on ubuntu
Description: I used workflow to auto test code, it was working fine 10 days ago, and now I am having this error:
Action version: 2-4
Platform:
Runner type:
Tools version:
‘3.6’, ‘3.7’, ‘3.8’, ‘3.9’, ‘3.10.0’ Repro steps:
I changed
runs-on: ubuntu-latest
toruns-on: macos-latest
and it started working.Hi, @Yohlo 👋 ! I tried to reproduce your issue but on my self-hosted Ubuntu runner everything works as expected. May I ask you to create new issue with a broader explanation of your case? BTW, the latest stable version of the Python available now is 3.10. For unstable versions currently it’s 3.11.0-beta.3.
Hello @kldavis4 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
MacOS has its tool-cache pre-built pythons and should work out of box. If it does not please check if you use @v3 of setup-python
hello @kldavis4 ,
Sorry for delayed reply, i’ve just noticed you set AGENT_TOOLSDIRECTORY on your host instead of setting with the pipeline:
It is known inconvenience of configuring the action on self-hosted agent and it expected to be eliminated very soon with https://github.com/actions/setup-python/pull/394. As soon as the PR will be merged your build should start working like a charm.
I’m also running in to this situation with Linode, not exclusive to AWS deployments. Ubuntu 21.04 and 20.10 don’t behave, using 20.04 LTS does seem to resolve it.
It is pretty much using a cannon for a bird. You will have to install python to the OS on which you run the runner (what totally defies the purpose of this package: dynamically using any version).
Should be something like
yum add pythonX.X
I am using philips-labs/terraform-aws-github-runner so i use the following terraform variable to apply it: https://github.com/philips-labs/terraform-aws-github-runner/blob/68635ddb9e1828d50a5e62ce6c8c5da589d501cd/variables.tf#L170
+1, following on this
poke
Still not dead, and still wanting this issue to get attention. Someone alive?