You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MacOS self hosted runner using sudo to install Python? #1306
Description:
I'm using setup-python@v5 on a MacOS self hosted runner and when configuring a Python interpreter not previously cached already I'm getting this:
So it's trying to use sudo and interactively asking me for a password to create the new version. I have the cache directory configured properly with write permissions as described in the documentation:
I managed to get 3.13 installing by interactively starting the runner and typing in the password manually when the action was executed. This allowed things to proceed correctly after the 3.13.13 area was created.
Looking at the issues this kind of smells like #1301 too. The symlinks are created in my case though once I type a password.
Action version:
v5
Platform:
Ubuntu
macOS
Windows
Runner type:
Hosted
Self-hosted
Tools version:
See above, Python 3.13.
Repro steps:
Just create a basic action using setup-python@v5 to install a Python interpreter.
Expected behavior:
The interpreter installs correctly.
Actual behavior:
The interpreter does not get installed and the workflow stops execution.
Thanks @priyagupta108. Assuming that the directory for the cache is setup properly I'd not think that sudo is required to make the install work in that directory tree.
On macOS, setup-python installs Python from a prebuilt .pkg into the root-owned /Library/Frameworks/, so it runs sudo installer ... -target /. This requires sudo, which prompts for a password unless the runner user has passwordless sudo — GitHub-hosted runners have this configured, self-hosted ones don't by default. That's why you see the interactive prompt; it's the OS working as designed, not a tool cache issue.
Activity
v-priyagupta108 commentedon Apr 24, 2026
Hello @dnwillia-work 👋,
Thank you for your report. We'll investigate the issue and get back to you with the details!
dnwillia-work commentedon Apr 24, 2026
Thanks @priyagupta108. Assuming that the directory for the cache is setup properly I'd not think that sudo is required to make the install work in that directory tree.
WKBae commentedon Jun 23, 2026
+1
installers/macos-pkg-setup-template.sh:50 in actions/python-versions runs
sudo installer ...v-mahabaleshwars commentedon Jul 2, 2026
Hello @dnwillia-work,
On macOS,
setup-pythoninstalls Python from a prebuilt.pkginto the root-owned/Library/Frameworks/, so it runssudo installer ... -target /. This requires sudo, which prompts for a password unless the runner user has passwordless sudo — GitHub-hosted runners have this configured, self-hosted ones don't by default. That's why you see the interactive prompt; it's the OS working as designed, not a tool cache issue.To resolve it on your self-hosted runner, please follow the setup and configuration guidance in Using setup-python with a self-hosted runner.
This is a known scenario for self-hosted macOS runners — see #760 for a similar issue and additional discussion that may be helpful.
v-mahabaleshwars commentedon Jul 15, 2026
Hello @dnwillia-work, can you confirm if the above feedback resolves the issue?
v-mahabaleshwars commentedon Jul 23, 2026
Hello @dnwillia-work, just a friendly reminder to confirm if the above feedback resolves the issue?
v-mahabaleshwars commentedon Aug 3, 2026
Hello @dnwillia-work,
We are closing this issue for now due to inactivity. Please feel free to reach out if the issue persists, and we can reopen it.