Python 3.10 on macos-latest fails with error '/usr/local/opt/gettext/lib/libintl.8.dylib' (no such file)
Description:
Our GH workflows are failing for the combination of Python 3.10 and macos-latest. The error we get in the logs looks like this:
Installed versions
Version 3.[10](https://github.com/quantumlib/Cirq/actions/runs/10498946616/job/30452107299#step:3:11) 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.15-10765692022/python-3.10.15-darwin-x64.tar.gz"
Extract downloaded archive
/usr/bin/tar xz -C /Users/runner/work/_temp/c443[13](https://github.com/quantumlib/Cirq/actions/runs/10498946616/job/30452107299#step:3:14)fc-a1b6-4f5b-8fd1-377a00a63aab -f /Users/runner/work/_temp/e941f901-bdc2-4390-b472-943a744a4907
Execute installation script
Check if Python hostedtoolcache folder exist...
Create Python 3.10.[15](https://github.com/quantumlib/Cirq/actions/runs/10498946616/job/30452107299#step:3:16) 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...
Error: dyld[2863]: Library not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib
Referenced from: <B5E9[16](https://github.com/quantumlib/Cirq/actions/runs/10498946616/job/30452107299#step:3:17)E8-01CA-35D0-8CA1-DB48CC803EB7> /Users/runner/hostedtoolcache/Python/3.10.15/x64/bin/python3.10
Reason: tried: '/usr/local/opt/gettext/lib/libintl.8.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/gettext/lib/libintl.8.dylib' (no such file), '/usr/local/opt/gettext/
Error: lib/libintl.8.dylib' (no such file), '/usr/local/lib/libintl.8.dylib' (no such file), '/usr/lib/libintl.8.dylib' (no such file, not in dyld cache)
./setup.sh: line 54: 2863 Abort trap: 6 ./python -m ensurepip
Error: The process '/bin/bash' failed with exit code 134
This does not appear to be under our control. The copy of the tarball the action is getting matches what is listed in https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json.
Action version:
actions/setup-python@v5
Platform:
- [ ] Ubuntu
- [x] macOS
- [ ] Windows
Runner type:
- [x] Hosted
- [ ] Self-hosted
Tools version: Python 3.10
Repro steps:
Use a workflow with a definition similar to this:
macos:
name: Pytest MacOS
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
Expected behavior:
Running a GitHub Actions workflow with macos-latest and Python 3.10 should not given an error.
Actual behavior: An example of the failure of a CI job can be seen here: https://github.com/quantumlib/Cirq/actions/runs/10498946616/job/30452107299#step:3:22
Hello @mhucka 👋, Thank you for reporting this issue. We will investigate it and get back to you as soon as we have some feedback.
Hi @mhucka, The actions/setup-python repository does not support x64 packages for Python <3.11 version on macOS arm64 runners due to compatibility and build issues. The build process for Python versions less than 3.11 involves downloading the official Python sources from python.org and building them using the make tool on the oldest available version of macOS that was available when that Python version was released. This is done to ensure backward compatibility for those Python versions as mentioned in this python-versions documentation . However, this build process can run into compatibility issues on macOS arm64 runners. The arm64 architecture is used in Apple's newer Mac models that use Apple Silicon processors, which are based on a different instruction set than the x86-64 processors used in older models. Therefore, the built Python packages for versions less than 3.11 may trigger the issues like few modules missing on macOS arm64 runners. This is why the actions/setup-python repository does not support x64 packages for <Python 3.11 versions on macOS arm64 runners. For Python versions 3.11 and onwards, the actions/setup-python repository uses the official macOS universal2 Python binaries from python.org, which are compatible with both x86-64 and arm64 architectures. These can be used on macOS arm64 runners without any issues. For Arm64 platform, we use official macOS universal2 Python binaries and provide only versions which are provided by Python org. Hence we are closing this issue as x64 packages for < python 3.11 from source will not be supported by macos arm64 runners. Please feel free to reach us needed to reopen this issue for more clarifications.