LinuxCommandLibrary

pip-check

Verify installed package dependency compatibility

TLDR

Check for broken or missing requirements

$ pip check
copy

Check and log output to a file
$ pip check --log [path/to/file]
copy

SYNOPSIS

pip check [options]

PARAMETERS

-q, --quiet
    Reduce output verbosity. Can be repeated up to 3 times.

-v, --verbose
    Increase output verbosity. Can be repeated up to 3 times.

--disable-pip-version-check
    Disable the pip version check.

--no-color
    Suppress colored output.

DESCRIPTION

The pip check command verifies that the installed Python packages in the current environment have compatible dependencies. It analyzes the metadata of installed distributions to detect broken dependencies, version conflicts, or missing requirements. If issues are found, it reports them clearly, such as "packageA 1.0 requires packageB>=2.0, but you have packageB 1.5".

This tool is essential for maintaining a healthy Python environment, especially after installing or upgrading packages. It helps prevent runtime errors caused by incompatible dependencies without needing to run the code. Note that it only examines explicitly installed packages and their direct dependencies against what's currently installed; it does not perform deep transitive analysis or check for vulnerabilities.

pip check is non-destructive—it only reports issues and exits with a non-zero status code if problems are detected, making it ideal for CI/CD pipelines or pre-commit hooks. Use it regularly to ensure your project's dependency graph remains consistent.

CAVEATS

Only detects conflicts among installed packages; ignores editable installs and development dependencies. Requires pip >=10.0. Does not fix issues—use pip install --upgrade manually.

EXIT CODES

0 if no issues; 1 if dependency conflicts found.

EXAMPLES

pip check
Verify all dependencies.

pip check -q
Quiet mode, exit non-zero on issues.

HISTORY

Introduced in pip 10.0.0 (April 2018) to simplify dependency verification, replacing reliance on third-party tools like pipdeptree. Enhanced in later versions for better conflict reporting.

SEE ALSO

pip(1), pip-list(1), pip-freeze(1)

Copied to clipboard