setup-python fails on self-hosted macOS: newer darwin Python assets require interactive sudo (installer -pkg)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- github-actions, macos, shell, typescript
Research direction
The failing sudo installer -pkg call comes from the generated setup.sh, built from installers/macos-pkg-setup-template.sh (line 50) in actions/python-versions, so that template is the first file to read. The error surfaces in setup-python's install-from-prebuilt-package step, which is where an explicit failure message would go. Done means either a documented sudo requirement or a clear error for the no-TTY case, and the maintainers still need to decide whether a relocatable layout is in scope.
Written by the indexing model from the issue text.
Description
Problem
On a self-hosted macOS runner, actions/setup-python@v7 fails for Python versions whose darwin asset installs via sudo installer -pkg (e.g. 3.12.10):
Version 3.12 was not found in the local cache
Download from .../python-3.12.10-darwin-arm64.tar.gz
Execute installation script
Check if Python hostedtoolcache folder exist...
Install Python binaries from prebuilt package
##[error]sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
The asset's setup.sh (generated from actions/python-versions installers/macos-pkg-setup-template.sh, line 50) runs:
sudo installer -pkg $PYTHON_PKG_NAME ... -target /
The runner service user has no TTY, so any host without passwordless sudo for /usr/sbin/installer fails. Older assets (e.g. 3.11.9) shipped plain directory trees and installed unprivileged.
Suggestion
Document the sudo requirement and/or fail with an explicit message; a relocatable (unprivileged) darwin asset layout would remove the requirement entirely.
Related: #914, #1387.
🤖 Generated with Claude Code
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 752
- Avg merge
- 22d 15h
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from actions/setup-python
-
bug needs triage
Difficulty 3/5 1-2 days Newbie friendliness 32/100
actions/setup-python#1392 · 1 comment · 4 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 57/100
actions/setup-python#1390 · 2 comments ·
-
standard pip version is below 26.2.2Possibly taken @v-gowridurgad claimed this 21 days ago. Openbug
Difficulty 4/5 3-5 days Newbie friendliness 38/100
actions/setup-python#1380 · 11 comments · 1 assignee ·
-
Python 3.15.0 on Ubuntu is missing the C _decimal modulePossibly taken @v-gowridurgad claimed this 29 days ago. Openbug
actions/setup-python#1376 · 1 comment · 1 reaction · 1 assignee ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
actions/setup-python#1348 · 6 comments ·
All issues in actions/setup-python
Similar issues
-
bug impact:low Team: SecuritySolution Team:Defend Workflows v9.6.0
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
elastic/kibana#306401 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
agentes-chat/agentes-chat#927 ·
Maintainers usually reply within 1 day
-
comp/desktop P2 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NousResearch/hermes-agent#157702 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
e2e-failure ready-to-code
Difficulty 1/5 Under an hour Newbie friendliness 72/100
redhat-developer/rhdh-plugin-export-overlays#4794 · 1 comment ·
Maintainers usually reply within 1 day