setup-python can install Python and cache pip, pipenv, or poetry packages
Answer: GitHub-hosted runners have a tools cache with pre-installed software, which includes Python and PyPy. The actions/setup-python action finds a specific version of Python from the tools cache and adds the binaries to PATH.
Package caching
Advanced usage documents Caching packages. Examples set python-version: '3.13' with cache: 'pip'. Other examples use cache: 'pipenv' and cache: 'poetry'. cache-dependency-path can list file paths or wildcard patterns such as **/requirements-dev.txt.
A tutorial workflow uses python-version: "3.13" and then installs dependencies with pip.
See also
- github-actions-caching
- github-actions-workflow-basics
- github-actions-concurrency
- github-actions-artifacts
Claims
- id: C1 claim: GitHub-hosted runners have a tools cache that includes Python and PyPy. source: S1 evidence: "hosted runners have a tools cache with pre-installed software, which includes Python and PyPy."
- id: C2 claim: The tutorial uses actions/setup-python with python-version 3.13. source: S1 evidence: "python-version: \"3.13\""
- id: C3 claim: setup-python advanced usage has a Caching packages section. source: S2 evidence: "## Caching packages"
- id: C4 claim: You can set cache to pip next to python-version. source: S2 evidence: "cache: 'pip'"
Sources
- [S1] Building and testing Python. GitHub Docs. https://docs.github.com/en/actions/tutorials/build-and-test-code/python . License: CC-BY-4.0. Accessed 2026-11-16.
- [S2] setup-python advanced usage. actions/setup-python (GitHub). https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md . License: MIT. Accessed 2026-11-16.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: GitHub Docs, Building and testing Python, CC-BY-4.0 (https://raw.githubusercontent.com/github/docs/main/LICENSE). Copyright GitHub, Inc.; actions/setup-python (GitHub), setup-python advanced usage, MIT (https://raw.githubusercontent.com/actions/setup-python/main/LICENSE). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: GitHub Docs, Building and testing Python, CC-BY-4.0 (https://raw.githubusercontent.com/github/docs/main/LICENSE). Copyright GitHub, Inc.; actions/setup-python (GitHub), setup-python advanced usage, MIT (https://raw.githubusercontent.com/actions/setup-python/main/LICENSE).
Cite this
iinventedlight. 2026. "setup-python can install Python and cache pip, pipenv, or poetry packages." iinventedlight Library, iil:note:1cxjrh2r, version of 2026-11-16. https://iinventedlight.com/library/notes/github-actions-setup-python/. License: CC-BY-4.0.
@misc{iil_note_1cxjrh2r,
author = {{iinventedlight}},
title = {{setup-python can install Python and cache pip, pipenv, or poetry packages}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-16},
url = {https://iinventedlight.com/library/notes/github-actions-setup-python/},
note = {Permanent ID iil:note:1cxjrh2r. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/github-actions-setup-python.md.