Skip to content

$pythonLocation/python does not exist for pypy3.11 on ubuntu-latest #1138

Description

@bkeryan

Description:
For most Python versions, $pythonLocation/python is a symlink to the Python binary, but it does not exist for pypy3.11 on ubuntu-latest.

Action version:
v5.6.0

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
pypy3.11

Repro steps:
https://github.com/ni/python-actions/blob/19f10ada84cc1b9a8ad848244dee3a39e67ccdec/.github/workflows/test_actions.yml#L215

  test_python_location:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [windows-latest, ubuntu-latest]
        python-version: [3.11, pypy3.11]
    steps:
      - uses: actions/setup-python@v5.6.0
        with:
          python-version: ${{ matrix.python-version }}
      - run: ls -al "$pythonLocation"
        shell: bash
      - run: |
          "$pythonLocation/python" -V
        shell: bash

Expected behavior:
The directory contains the python symlink or stub and it successfully prints the Python version.

windows-latest, 3.11:

Run ls -al $pythonLocation
total 33396
drwxr-xr-x 1 runneradmin 197121        0 Jun  9 23:14 .
drwxr-xr-x 1 runneradmin 197121        0 Jun  9 23:17 ..
drwxr-xr-x 1 runneradmin 197121        0 Jun  9 23:14 DLLs
drwxr-xr-x 1 runneradmin 197121        0 Jun  9 23:14 Doc
-rw-r--r-- 1 runneradmin 197121    36874 Apr  2  2024 LICENSE.txt
drwxr-xr-x 1 runneradmin 197121        0 Jun  9 23:14 Lib
-rw-r--r-- 1 runneradmin 197121  1563659 Apr  2  2024 NEWS.txt
drwxr-xr-x 1 runneradmin 197121        0 Jun  9 23:14 Scripts
drwxr-xr-x 1 runneradmin 197121        0 Jun  9 23:14 Tools
drwxr-xr-x 1 runneradmin 197121        0 Jun  9 23:14 include
drwxr-xr-x 1 runneradmin 197121        0 Jun  9 23:14 libs
-rwxr-xr-x 1 runneradmin 197121 26216840 Jul 15  2024 python-3.11.9-amd64.exe
-rwxr-xr-x 1 runneradmin 197121   103192 Apr  2  2024 python.exe
-rwxr-xr-x 1 runneradmin 197121    67352 Apr  2  2024 python3.dll
lrwxrwxrwx 1 runneradmin 197121       55 Jun  9 23:14 python3.exe -> /c/hostedtoolcache/windows/Python/3.11.9/x64/python.exe
-rwxr-xr-x 1 runneradmin 197121  5800216 Apr  2  2024 python311.dll
-rwxr-xr-x 1 runneradmin 197121   101656 Apr  2  2024 pythonw.exe
drwxr-xr-x 1 runneradmin 197121        0 Jun  9 23:14 tcl
-rwxr-xr-x 1 runneradmin 197121   119192 Apr  2  2024 vcruntime140.dll
-rwxr-xr-x 1 runneradmin 197121    49528 Apr  2  2024 vcruntime140_1.dll

windows-latest, pypy3.11:

Run ls -al $pythonLocation
total 46021
drwxr-xr-x 1 runneradmin 197121        0 Jun 16 17:33 .
drwxr-xr-x 1 runneradmin 197121        0 Jun 16 17:33 ..
-rw-r--r-- 1 runneradmin 197121    13385 Feb 26 13:04 LICENSE
drwxr-xr-x 1 runneradmin 197121        0 Jun 16 17:33 Lib
-rw-r--r-- 1 runneradmin 197121        6 Jun 16 17:33 PYPY_VERSION
-rw-r--r-- 1 runneradmin 197121     1143 Feb 26 13:04 README.rst
drwxr-xr-x 1 runneradmin 197121        0 Jun 16 17:33 Scripts
drwxr-xr-x 1 runneradmin 197121        0 Jun 16 17:33 include
-rwxr-xr-x 1 runneradmin 197121    27648 Feb 26 13:04 libffi-8.dll
-rwxr-xr-x 1 runneradmin 197121 46200832 Feb 26 13:04 libpypy3.11-c.dll
drwxr-xr-x 1 runneradmin 197121        0 Jun 16 17:33 libs
-rwxr-xr-x 1 runneradmin 197121    81408 Feb 26 13:04 pypy.exe
-rwxr-xr-x 1 runneradmin 197121    81408 Feb 26 13:04 pypy3.11.exe
-rwxr-xr-x 1 runneradmin 197121    81408 Feb 26 13:04 pypy3.11w.exe
-rwxr-xr-x 1 runneradmin 197121    81408 Feb 26 13:04 pypy3.exe
-rwxr-xr-x 1 runneradmin 197121    81408 Feb 26 13:04 pypyw.exe
-rwxr-xr-x 1 runneradmin 197121    81408 Feb 26 13:04 python.exe
-rwxr-xr-x 1 runneradmin 197121    81408 Feb 26 13:04 python3.11.exe
-rwxr-xr-x 1 runneradmin 197121    81408 Feb 26 13:04 python3.exe
-rwxr-xr-x 1 runneradmin 197121    81408 Feb 26 13:04 pythonw.exe
drwxr-xr-x 1 runneradmin 197121        0 Jun 16 17:33 tcl

ubuntu-latest, 3.11:

Run ls -al $pythonLocation
total 26968
drwxrwxrwx+ 6 runner runneradmin     4096 Jun  9 10:06 .
drwxrwxrwx+ 3 runner runneradmin     4096 Jun  9 10:06 ..
-rwxrwxrwx  1 runner runneradmin 26581523 Jun  9 10:06 Python-3.11.13.tgz
drwxrwxrwx+ 2 runner runneradmin     4096 Jun  9 10:06 bin
-rwxrwxrwx  1 runner runneradmin   358758 Jun  9 10:06 build_output.txt
drwxrwxrwx+ 3 runner runneradmin     4096 Jun  9 10:06 include
drwxrwxrwx+ 4 runner runneradmin     4096 Jun  9 10:06 lib
lrwxrwxrwx  1 runner runneradmin       16 Jun  9 10:06 python -> ./bin/python3.11
drwxrwxrwx+ 3 runner runneradmin     4096 Jun  9 10:06 share
-rwxrwxrwx  1 runner runneradmin   644183 Jun  9 10:06 tools_structure.txt

Actual behavior:

The directory does not contain the python symlink and running "$pythonLocation/python" -V fails with "no such file or directory".

ubuntu-latest, pypy3.11:

Run actions/setup-python@v5.6.0
Installed versions
  PyPy version 3.11 (x) was not found in the local cache
  Downloading PyPy from "https://downloads.python.org/pypy/pypy3.11-v7.3.19-linux64.tar.bz2" ...
  Extracting downloaded archive...
  /usr/bin/tar x --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/5109c90c-7960-4345-a70e-f60d28f861f6 -f /home/runner/work/_temp/faa5f69f-d068-4dbb-86eb-edb3078d1b5d
  Creating symlinks...
  Installing and updating pip
  /opt/hostedtoolcache/PyPy/3.11.11/x64/bin/python -m ensurepip
  Looking in links: /tmp/tmp7d44vzhy
  Processing /tmp/tmp7d44vzhy/setuptools-65.5.0-py3-none-any.whl
  Processing /tmp/tmp7d44vzhy/pip-24.0-py3-none-any.whl
  Installing collected packages: setuptools, pip
  Successfully installed pip-24.0 setuptools-65.5.0
  /opt/hostedtoolcache/PyPy/3.11.11/x64/bin/python -m pip install --ignore-installed pip
  Collecting pip
    Downloading pip-25.1.1-py3-none-any.whl.metadata (3.6 kB)
  Downloading pip-25.1.1-py3-none-any.whl (1.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 39.2 MB/s eta 0:00:00
  Installing collected packages: pip
  Successfully installed pip-25.1.1
  Successfully set up PyPy 7.3.19 with Python (3.11.11)
Run ls -al "$pythonLocation"
total 44
drwxrwxrwx+ 5 runner docker  4096 Jun 16 17:51 .
drwxrwxrwx+ 3 runner docker  4096 Jun 16 17:51 ..
-rw-r--r--+ 1 runner docker 12800 Jun 16 17:51 LICENSE
-rw-rw-rw-+ 1 runner docker     6 Jun 16 17:51 PYPY_VERSION
-rw-r--r--+ 1 runner docker  1143 Jun 16 17:51 README.rst
drwxr-xr-x+ 2 runner docker  4096 Jun 16 17:51 bin
drwxr-xr-x+ 3 runner docker  4096 Jun 16 17:51 include
drwxr-xr-x+ 5 runner docker  4096 Jun 16 17:51 lib
Run "$pythonLocation/python" -V
/home/runner/work/_temp/e346c099-c7a4-4c91-bc09-2ddd1d59b6ee.sh: line 1: /opt/hostedtoolcache/PyPy/3.11.11/x64/python: No such file or directory
Error: Process completed with exit code 127.

Workaround

  • Don't use $pythonLocation with PyPy
  • Use $pythonLocation/bin/python or $pythonLocation/Scripts/python depending on OS

Activity

suyashgaonkar commented on Jun 17, 2025

@suyashgaonkar

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

v-aparnajyothi-y commented on Jun 20, 2025

@v-aparnajyothi-y
Contributor

Hello @bkeryan, Thank you for reporting this. We have investigated the issue and confirmed that $pythonLocation/python does not exist for PyPy 3.11 on ubuntu-latest, whereas it does exist for CPython versions. This difference is expected due to how the setup-python action installs and structures the toolcache for each implementation.

For CPython, the installation scripts (used on Linux, macOS, and Windows) explicitly ensure that the main Python executable (python or python.exe) is symlinked or placed directly at the top-level toolcache path ($pythonLocation). This is done through purpose-built setup scripts that:

  • Create a python symlink at $pythonLocation pointing to the appropriate binary (Linux/macOS)

  • Ensure the main executable is copied/symlinked to $pythonLocation\python.exe (Windows).

These steps are part of our controlled installation logic for CPython, and the builds are managed and structured via the actions/python-versions repository.

However, for PyPy, the upstream-provided tarballs or zip packages are used directly without restructuring. These packages locate the Python binary under bin/ (on Linux/macOS) or Scripts/ (on Windows), and no shim or symlink is added to expose $pythonLocation/python. Since we do not repackage or modify the PyPy toolcache layout like we do for CPython, the $pythonLocation/python path does not exist for PyPy versions.

We also recommend referencing the Python executable directly using:

  • $pythonLocation/bin/python on Linux/macOS
  • $pythonLocation/Scripts/python.exe or $pythonLocation/python.exe on Windows

Please let us know if you need further clarification or assistance.

v-aparnajyothi-y commented on Jul 2, 2025

@v-aparnajyothi-y
Contributor

Hello @bkeryan, Please let us know if you have any concerns on the above :)

bkeryan commented on Jul 9, 2025

@bkeryan
Author

Hello @bkeryan, Thank you for reporting this. We have investigated the issue and confirmed that $pythonLocation/python does not exist for PyPy 3.11 on ubuntu-latest, whereas it does exist for CPython versions. This difference is expected due to how the setup-python action installs and structures the toolcache for each implementation.

This would be useful information to include in https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#available-versions-of-python-pypy-and-graalpy

We also recommend referencing the Python executable directly using:

  • $pythonLocation/bin/python on Linux/macOS
  • $pythonLocation/Scripts/python.exe or $pythonLocation/python.exe on Windows

Please let us know if you need further clarification or assistance.

This would be useful information to include in https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#environment-variables in the section about the pythonLocation variable. It currently doesn't suggest how to use $pythonLocation, and some ways of using it work with CPython but not PyPy.

v-aparnajyothi-y commented on Aug 29, 2025

@v-aparnajyothi-y
Contributor

Hello @bkeryan , This issue has been addressed in PR #1183 to update setup-python documentation about the pythonLocation variable for cpython, pypy and graalpy, and will be included in the upcoming releases..

We’ll be closing this issue. Please feel free to reach out if you have any further concerns or need additional assistance. Thanks again for your suggestion and feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions