Skip to content

Doesn't work on windows #1060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 of 5 tasks
sijjay opened this issue Mar 21, 2025 · 8 comments
Closed
2 of 5 tasks

Doesn't work on windows #1060

sijjay opened this issue Mar 21, 2025 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@sijjay
Copy link

sijjay commented Mar 21, 2025

Description:
Trying to e this action on elf-hosted windows runners

    - uses: actions/setup-python@v5
      with:
        python-version: ${{ inputs.python_version }}

Action version:
v5

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

Python 3.10
Windows_NT

Repro steps:
Just run this action on Windwos_NT

Expected behavior:
Works smoothly as it does on Linux

Actual behavior:
Error:

Run actions/setup-python@v5
  
Installed versions
  Version 3.10 was not found in the local cache
  Version 3.10 is available for downloading
  Download from "https://github.com/actions/python-versions/releases/download/3.10.11-11114431484/python-3.10.11-win32-x64.zip"
  Extract downloaded archive
  C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath 'E:\actions-runner\_work\_temp\python-3.10.11-win32-x64.zip' -DestinationPath 'E:\actions-runner\_work\_temp\98799a9c-7702-4d8c-bbda-57b256f4beef' -Force } else {[System.IO.Compression.ZipFile]::ExtractToDirectory('E:\actions-runner\_work\_temp\python-3.10.11-win32-x64.zip', 'E:\actions-runner\_work\_temp\98799a9c-7702-4d8c-bbda-57b256f4beef', $true) }"
  Execute installation script
  Windows PowerShell
  Copyright (C) 2014 Microsoft Corporation. All rights reserved.
  ********************************************************
  *********     THIS IS A PRODUCTION SYSTEM!     *********
  ********************************************************
  Please use extreme caution in this environment...
  Check if Python hostedtoolcache folder exist...
  Create Python toolcache folder
  Check if current Python version is installed...
  No Python3.10.* found
  Remove registry entries for Python 3.10(x64)...
  Create Python 3.10.11 folder in E:\actions-runner\_work\_tool\Python
  Copy Python binaries to E:\actions-runner\_work\_tool\Python\3.10.11\x64
  Install Python 3.10.11 in E:\actions-runner\_work\_tool\Python...
  Error: Error happened during Python installation
  Error: At E:\actions-runner\_work\_temp\98799a9c-7702-4d8c-bbda-57b256f4beef\setup.ps1:127 char:5
  +     Throw "Error happened during Python installation"
  +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : OperationStopped: (Error happened ...on installation:String) [], RuntimeException
      + FullyQualifiedErrorId : Error happened during Python installation
  Error: The process 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' failed with exit code 1
@sijjay sijjay added bug Something isn't working needs triage labels Mar 21, 2025
@AdamBryantLaunchWindow
Copy link

This is occurring for me also. I followed the guidance for self hosted windows, with no change.

@suyashgaonkar
Copy link

suyashgaonkar commented Mar 24, 2025

Hi @sijjay , Thank you for creating this issue. We will investigate it and provide feedback as soon as we have some updates.

@priya-kinthali priya-kinthali self-assigned this Mar 24, 2025
@priya-kinthali
Copy link
Contributor

priya-kinthali commented Mar 26, 2025

Hello there👋,
Thank you for reporting this issue.
We were unable to reproduce the error on our end, and it appears to be related to the runner configuration setup rather than the setup-python action. The error you are experiencing could be due to the following reasons:

  • Administrator Privileges: Ensure that your self-hosted runner is running with administrator privileges. This is necessary for setting up the appropriate directories and files when downloading and installing a new version of Python. If your runner is configured as a service, make sure the account that is running the service has the appropriate write permissions so that Python can get installed. Please refer to the documentation for further details related to using setup-python with a self-hosted runner.

  • Disk Space: Ensure that the runner has sufficient disk space. Lack of adequate space can hinder the installation of Python and other necessary packages.

  • Concurrency Issues: If multiple processes attempt to access or modify the same resources (such as the Python installation directory), it could lead to conflicts and cause the installation to fail.

For further troubleshooting, we recommend re-running the job and trying different Python versions with actions/setup-python@v5. Additionally, you can clear any existing tool cache in your runner using the following snippet and re-run the workflow:

- name: Clear any existing tool cache
  run: |
    mv "${{ runner.tool_cache }}" "${{ runner.tool_cache }}.old"
    mkdir -p "${{ runner.tool_cache }}"
- uses: actions/setup-python@v5
  with:
    python-version: ‘3.x’

We hope this information is helpful. Please let us know if you have any further questions or concerns.

@priya-kinthali
Copy link
Contributor

Hello @sijjay👋,
Just giving you a gentle ping to see if there have been any updates or if any of the suggested workarounds helped resolve the issue. Thank you!

@arunk3200
Copy link

self hosted runner : This is occurring for me also.

@priya-kinthali
Copy link
Contributor

Hello @arunk3200👋,
Could you please try the troubleshooting steps mentioned in the previous comment and let us know if that helps resolve the issue? It could be related to the runner configuration setup.
Hello @sijjay👋, Just a gentle reminder regarding this issue, If you have any updates or need further assistance, Please let us know. Thank you!

@arunk3200
Copy link

Hello @priya-kinthali,
Below recommendation works for me on Windows Self hosted runner.

  • name: Clear any existing tool cache
    run: |
    mv "${{ runner.tool_cache }}" "${{ runner.tool_cache }}.old"
    mkdir -p "${{ runner.tool_cache }}"
  • uses: actions/setup-python@v5
    with:
    python-version: ‘3.x’

@priya-kinthali
Copy link
Contributor

Hello @sijjay👋,
We’ll proceed with closing this issue for now, as we haven’t received a response. Please feel free to reopen it or reach out to us if needed. Thank you! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants