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
Unsuppressed warnings about running pip as the root user when using self-hosted runners #1217
Description:
I'm using the setup-python action with CodeBuild self-hosted runners. This works great but does output this warning:
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
This problem has been brought up (but not fixed) by past issues:
In ticket #930 it was correctly noted that ensurepip does not honor the PIP_ROOT_USER_ACTION environment variable. I have also confirmed that it is ensurepip (and not pip) producing these warnings. I asked the cpython team about this and as I understand, ensurepip should only be invoked when initially building python. Because the actions script installs a pre-built python, the call to ensurepip is not needed and can be removed.
AFAICT there is no specific reason this call is included in the script. Any objection to removing it?
Action version:
v6 and v5 for sure, seemingly others too
Platform:
Ubuntu
macOS
Windows
Runner type:
Hosted
Self-hosted
Tools version:
3.11, 3.12, 3.13 for sure
Repro steps:
Just create a step that installs python while running on a CodeBuild-hosted Github Actions runner. Likely will also repro with other types of self-hosted runners too.
- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: 3.13
Expected behavior:
Python installs with no warnings
Actual behavior:
Python installs and works well, but prints the below warning: WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Reacted by Marius Boden, George, tbosnjak and Wilfrido Vidaña
Thank you for raising this issue. We want to assure you that we are actively investigating the root cause and are working towards a resolution. We appreciate your patience and the detailed information provided from your end. We'll keep you updated here as we make progress and will notify you once a solution is available. If you have any additional insights or observations in the meantime, please feel free to share them.
As we continue to investigate this warning with self-hosted runners, we would appreciate your feedback on whether you have encountered a similar issue when using Windows or macOS environments with the setup-python action. If you have experienced this warning on these platforms, could you please share your observations and any relevant details? Your input will help us ensure a comprehensive resolution across all environments.
Dear Zach,
Thank you for sharing your experience with the setup-python actions. It's always helpful to know the perspectives of users on different platforms. If you have any specific insights or tips related to Linux, I’d love to hear them!
Best regards,
[Your Name]
21 Kasım 2025 01:07:43 GMT+03:00, Zach Vickery ***@***.***> yazdı:
zvickery left a comment (actions/setup-python#1217)
I personally only use Linux and am unaware of the behavior on other platforms.
--
Reply to this email directly or view it on GitHub:
#1217 (comment)
You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
Thank you for reporting this issue and for providing such a thorough analysis of the ensurepip-related warning on self-hosted runners. We wanted to let you know that we have already raised a main PR to address this problem by conditionally skipping the unnecessary invocation of ensurepip. You can follow the progress and discussion here: PR 369.
We appreciate your patience and will keep you updated with any further changes or developments. Thank you again for your detailed feedback and engagement!
@zvickery,
We’ve opened another PR actions/python-versions#392 with an alternative approach to address the warning from the setup-python side by avoiding ensurepip when possible.
Please take a look when you have a chance, and let us know if there’s anything we should adjust.
@zvickery, We’ve opened another PR actions/python-versions#392 with an alternative approach to address the warning from the setup-python side by avoiding ensurepip when possible. Please take a look when you have a chance, and let us know if there’s anything we should adjust.
Seems great, thank you! If there is an way to test it I'm happy to do so
This has been addressed! The fix is merged into actions/python-versions as part of PR #392. Going forward, new Python version binaries will ship with this fix and the root user warning on self-hosted runners will no longer appear.
We're closing this issue. Please feel free to reach out if you have any questions or need further assistance.
Thanks again for the detailed report and repro steps!
Activity
v-gowridurgad commentedon Sep 29, 2025
Hi @zvickery,
Thank you for creating this issue. We will investigate it and provide feedback as soon as we have some updates.
v-lmvysakh commentedon Nov 3, 2025
Hi @zvickery,
Thank you for raising this issue. We want to assure you that we are actively investigating the root cause and are working towards a resolution. We appreciate your patience and the detailed information provided from your end. We'll keep you updated here as we make progress and will notify you once a solution is available. If you have any additional insights or observations in the meantime, please feel free to share them.
v-lmvysakh commentedon Nov 18, 2025
Hi everyone,
As we continue to investigate this warning with self-hosted runners, we would appreciate your feedback on whether you have encountered a similar issue when using Windows or macOS environments with the setup-python action. If you have experienced this warning on these platforms, could you please share your observations and any relevant details? Your input will help us ensure a comprehensive resolution across all environments.
Thank you in advance for your time and feedback!
zvickery commentedon Nov 20, 2025
I personally only use Linux and am unaware of the behavior on other platforms.
ersanhumeyra-boop commentedon Nov 20, 2025
v-lmvysakh commentedon Dec 4, 2025
Hi @zvickery,
Thank you for reporting this issue and for providing such a thorough analysis of the ensurepip-related warning on self-hosted runners. We wanted to let you know that we have already raised a main PR to address this problem by conditionally skipping the unnecessary invocation of ensurepip. You can follow the progress and discussion here: PR 369.
We appreciate your patience and will keep you updated with any further changes or developments. Thank you again for your detailed feedback and engagement!
v-priyagupta108 commentedon May 15, 2026
@zvickery,
We’ve opened another PR actions/python-versions#392 with an alternative approach to address the warning from the setup-python side by avoiding ensurepip when possible.
Please take a look when you have a chance, and let us know if there’s anything we should adjust.
zvickery commentedon May 15, 2026
Seems great, thank you! If there is an way to test it I'm happy to do so
v-priyagupta108 commentedon May 28, 2026
Hi 👋
This has been addressed! The fix is merged into actions/python-versions as part of PR #392. Going forward, new Python version binaries will ship with this fix and the root user warning on self-hosted runners will no longer appear.
We're closing this issue. Please feel free to reach out if you have any questions or need further assistance.
Thanks again for the detailed report and repro steps!