← All notes

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

Claims

Sources

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

Permanent ID: iil:note:1cxjrh2r

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.},
}

Markdown

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.