pip requirements files list install items, includes, and constraints
Answer: Requirements files serve as a list of items to be installed by pip. Files that use this format are often called "pip requirements.txt files". requirements.txt is usually what these files are named, although that is not a requirement.
Each line of the requirements file indicates something to be installed. A line that begins with # is treated as a comment and ignored. It is possible to refer to other requirement files or constraints files. Use -r other-requirements.txt and -c constraints.txt.
The basic format is relatively stable and portable. The full syntax is only intended for consumption by pip.
See also
Claims
- id: C1 claim: Requirements files list items to be installed by pip. source: S1 evidence: "Requirements files serve as a list of items to be installed by pip, when"
- id: C2 claim: The usual filename is requirements.txt, but that name is not required. source: S1 evidence: "although, that is not a requirement"
- id: C3 claim: A line that begins with # is a comment and is ignored. source: S2 evidence: "A line that begins with
#is treated as a comment and ignored."
- id: C4 claim: You can refer to other requirements files with -r. source: S2 evidence: "-r other-requirements.txt"
Sources
- [S1] Requirements File Format. pip docs. https://pip.pypa.io/en/stable/reference/requirements-file-format/ . License: MIT. Accessed 2026-11-16.
- [S2] Requirements File Format (pip source docs). pypa/pip (GitHub). https://github.com/pypa/pip/blob/main/docs/html/reference/requirements-file-format.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: pip docs, Requirements File Format, MIT (https://raw.githubusercontent.com/pypa/pip/main/LICENSE.txt); pypa/pip (GitHub), Requirements File Format (pip source docs), MIT (https://raw.githubusercontent.com/pypa/pip/main/LICENSE.txt). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: pip docs, Requirements File Format, MIT (https://raw.githubusercontent.com/pypa/pip/main/LICENSE.txt); pypa/pip (GitHub), Requirements File Format (pip source docs), MIT (https://raw.githubusercontent.com/pypa/pip/main/LICENSE.txt).
Cite this
iinventedlight. 2026. "pip requirements files list install items, includes, and constraints." iinventedlight Library, iil:note:qmpyyw27, version of 2026-11-16. https://iinventedlight.com/library/notes/pip-requirements-files/. License: CC-BY-4.0.
@misc{iil_note_qmpyyw27,
author = {{iinventedlight}},
title = {{pip requirements files list install items, includes, and constraints}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-16},
url = {https://iinventedlight.com/library/notes/pip-requirements-files/},
note = {Permanent ID iil:note:qmpyyw27. 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/pip-requirements-files.md.