-
Notifications
You must be signed in to change notification settings - Fork 566
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
setup-python
failing for 3.9 on macos-latest
#981
Comments
Hello @abravalheri, |
Hi @abravalheri, The issue arises due to the behavior of the The version of To resolve this issue and ensure the setup process completes successfully, you can set the |
Description:
The setup-python action started failing recently when installing Python 3.9 on the
macos-latest
.Please note that the setup-python action is the second one to run, just after checkout (this was previously the case for 3.8, but not 3.9).
https://github.com/pypa/setuptools/actions/runs/12298183072/job/34321035714#step:3:49
Action version:
actions/setup-python@v5 - https://github.com/pypa/setuptools/actions/runs/12298183072/job/34321035714#step:3:1
Platform:
Runner type:
Tools version:
Python 3.9
Repro steps:
A description with steps to reproduce the issue. If your have a public example or repo to share, please provide the link.
https://github.com/pypa/setuptools/actions/runs/12298183072/job/34321035714#step:3:49
Expected behavior:
The setup-python action should successfully install Python 3.9 on
macos-latest
independently of the contents of the repository where the action is running.Actual behavior:
The setup-python action fails to install Python 3.9 on
macos-latest
for the setuptools repository.Please note that this problem has already been previously reported:
#860
The assessment in #860 (comment) that the problem is being caused by setuptools itself is not completely accurate.
While it is true that old versions of
setuptools
did expect every frame to contain a__file__
attribute, this bug in the setuptools has been fixed around 3 years ago pypa/setuptools@137ab9d.What seems to be happening is that the host for the action has a pre-installed, very old version, and no longer supported version of setuptools, even before the action tries to run
ensurepip
. Because that old version of setuptools is installed in the host,ensurepip
fails.I believe that the best solution here is either:
setuptools
installedsetuptools
installedsetuptools
does not get loaded when trying to installpip
viaensurepip
.python -m ensurepip
with some form of isolation flag (like-I
)?Also note that the issue is happening on the setuptools repository specifically, which may mean the following:
cd
into/tmp
before running the commands on setup-python? Or use some of the isolation flags when running Python scripts (e.g. -I)?Please see more information in #860.
The text was updated successfully, but these errors were encountered: