Skip to content

pip-tools

pip-tools is a set of CLI tools that generate and apply fully pinned package requirement files for Python projects using pip.

Installation and Setup

Install it from PyPI:

Language: Windows PowerShell
(venv) PS> py -m pip install pip-tools
Language: Shell
(venv) $ python -m pip install pip-tools

Key Features

  • Compiles fully pinned requirements.txt files from requirements.in and can also compile from modern project metadata like pyproject.toml, including extras through --extra.
  • Resolves dependencies using pip tooling and generates hash-pinned outputs with --generate-hashes when you want stricter verification.
  • Controls upgrades with --upgrade for everything and --upgrade-package for targeted packages.
  • Syncs an environment to match the compiled files and removes extraneous packages with pip-sync.
  • Supports project defaults via .pip-tools.toml or pyproject.toml configuration under [tool.pip-tools].

Usage

Create an input file that lists only your direct dependencies:

Language: Text Filename: requirements.in
flask
requests

Compile a fully pinned requirements.txt file:

Language: Shell
$ pip-compile

Install exactly what is in requirements.txt in other system or environment:

Language: Shell
$ pip-sync

Upgrade everything to the latest compatible versions:

Language: Shell
$ pip-compile --upgrade
$ pip-sync

Upgrade selected packages only:

Language: Shell
$ pip-compile --upgrade-package requests
$ pip-sync

Compile from pyproject.toml and include an extra:

Language: Shell
$ pip-compile pyproject.toml --extra dev
Using Python's pip to Manage Your Projects' Dependencies

Tutorial

Using Python's pip to Manage Your Projects' Dependencies

What is pip? Learn how to use pip, Python's standard package manager, to install and manage packages that aren't part of the standard library.

basics tools

For additional information on related topics, take a look at the following resources:

Have a question about this? Mentor AI can show you examples, compare related terms, and point you to tutorials.


By Leodanis Pozo Ramos • Updated Oct. 31, 2026