pip-licenses "fail-on" GPL blocks the build in CI
pip-licenses inspected the installed distributions in the environment and found a package whose license matches your --fail-on list (for example GPL), so it exited non-zero to stop CI.
What this error means
pip-licenses prints the license table and exits 1 with a message about a package matching --fail-on. It only reports packages actually installed in the active environment.
fail-on license GPLv3 was found for package chardet:5.2.0
Error: fail-on license was detected.Common causes
An installed package uses a banned license
A dependency in the current virtualenv reports a license (via its metadata) that is on your --fail-on list, so pip-licenses fails the run.
License is read from installed metadata only
pip-licenses reads the installed environment, so a package must be installed to be evaluated; a mismatched or dev-only install can change results.
How to fix it
Gate with an allow-only list
- List the tree with
pip-licensesto see every license present. - Prefer
--allow-onlyso anything not permitted fails, not just named licenses. - Replace or remove the offending package, then re-run.
pip-licenses --allow-only="MIT;BSD License;Apache Software License;ISC License (ISCL)"Use fail-on for an explicit deny list
When you must ban specific licenses, pass them semicolon separated to --fail-on and read the metadata name exactly as pip-licenses prints it.
pip-licenses --fail-on="GNU General Public License v3 (GPLv3);GNU General Public License (GPL)"How to prevent it
- Run pip-licenses against the exact environment CI installs.
- Match license strings to the metadata names pip-licenses reports, not SPDX ids.
- Prefer an allow-only policy so new licenses fail closed.