Repository navigation
$pythonLocation/python does not exist for pypy3.11 on ubuntu-latest #1138
Description
Activity
Hi @bkeryan ,Thank you for creating this issue. We will investigate it and provide feedback as soon as we have some updates.
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.
Hello @bkeryan, Please let us know if you have any concerns on the above :)
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.
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!
Description:
For most Python versions,
$pythonLocation/pythonis a symlink to the Python binary, but it does not exist for pypy3.11 on ubuntu-latest.Action version:
v5.6.0
Platform:
Runner type:
Tools version:
pypy3.11
Repro steps:
https://github.com/ni/python-actions/blob/19f10ada84cc1b9a8ad848244dee3a39e67ccdec/.github/workflows/test_actions.yml#L215
Expected behavior:
The directory contains the
pythonsymlink or stub and it successfully prints the Python version.windows-latest, 3.11:
windows-latest, pypy3.11:
ubuntu-latest, 3.11:
Actual behavior:
The directory does not contain the
pythonsymlink and running"$pythonLocation/python" -Vfails with "no such file or directory".ubuntu-latest, pypy3.11:
Workaround
$pythonLocationwith PyPy$pythonLocation/bin/pythonor$pythonLocation/Scripts/pythondepending on OS