Freeze the current environment to a file.
Section: Requirements and lock-style workflows
Write a requirements snapshot
bash
bash
python -m pip freeze > requirements.txtExplanation
Captures exact package versions in pip format.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Requirements and lock-style workflows
Compare installed packages to requirements
Diff the current environment snapshot against a file.
Install a requirements file
Install project dependencies from requirements.txt.
Install development requirements
Install a second requirements file for dev-only tools.
Install from hash-checked requirements
Require pinned hashes during install.
Install without dependencies
Install a package while skipping dependency resolution.