Registry / devops / pip-licenses-cli

pip-licenses-cli

JSON →
library4.0.0pypypiunverified

A CLI tool to dump the software license list of Python packages installed with pip. Current version 4.0.0 requires Python >=3.10 and <4. It is a fork of pip-licenses with improved modularization and support for PEP 639 License-File field.

pip install pip-licenses-cli
INSTALL
IMPORT
SIG · PIP-LICENSES-CLI
P
pip-licenses-cli
devopspythonv4.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Run pip-licenses-cli as a subprocess and capture JSON output including license files.

import subprocess result = subprocess.run(['pip-licenses-cli', '--format=json', '--with-license-file', '--no-license-path'], capture_output=True, text=True) print(result.stdout)
pip-licenses-cli --version
Debug
Known issues
breakingVersion 4.0.0 changes behavior for packages with UNKNOWN license: they are now omitted from plain-vertical output and result in empty lists in JSON output, whereas previously they were included as UNKNOWN. This may break scripts relying on the old behavior.
fix
Update parsing logic to handle missing license entries. To restore old behavior, open an issue to request a flag.
affects: >=4.0.0
breakingVersion 3.0.0 drops support for Python 3.9. Ensure your Python version is >=3.10.
fix
Upgrade Python to 3.10 or later.
affects: >=3.0.0
deprecatedThe --with-license-file flag combined with --no-license-path is the recommended way to include inline license texts. Using --with-license-file alone will print file paths instead.
fix
Add --no-license-path if you want the license text inline.
affects: all
gotchaConfiguration from pyproject.toml is read from the [tool.pip-licenses-cli] section (not [tool.pip-licenses]). Using the wrong section name will silently ignore your config.
fix
Use [tool.pip-licenses-cli] in pyproject.toml.
affects: all
gotchaThe --ignore-packages flag requires full package names (e.g., 'requests') not versioned or partial names.
fix
Specify exact package names separated by commas.
affects: all
Errors
Common errors & fixes
Command 'pip-licenses-cli' not found
The package is not installed in the current environment.
fix
Run 'pip install pip-licenses-cli'.
ModuleNotFoundError: No module named 'pip_licenses_cli'
Trying to import the package directly instead of running it as a CLI tool.
fix
Do not import pip_licenses_cli as a Python module; use 'pip-licenses-cli' as a command-line tool.
Upgrade
Version history
4.0.0latest on PyPI · released Feb 16, 2026
Audit
Dependencies
piprequiredRequired to access installed packages metadata
prettytableoptionalUsed for table output formatting
tomlioptionalUsed for reading pyproject.toml configuration on Python <3.11
boolean.pyoptionalUsed for SPDX expression parsing
Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
2
Amazon
1
Resources
pip-licenses-cli — pip install pip-licenses-cli · libregistry