{"record":{"id":"d7af692417dfadec","repo":"pypa/pip","slug":"list-format-freeze-cannot-be-used-with-the-out","errorCode":null,"errorMessage":"List format 'freeze' cannot be used with the --outdated option.","messagePattern":"List format 'freeze' cannot be used with the --outdated option\\.","errorType":"exception","errorClass":"CommandError","httpStatus":null,"severity":"error","filePath":"src/pip/_internal/commands/list.py","lineNumber":180,"sourceCode":"            release_control=options.release_control,\n            format_control=options.format_control,\n            prefer_binary=options.prefer_binary,\n        )\n\n        return PackageFinder.create(\n            link_collector=link_collector,\n            selection_prefs=selection_prefs,\n            uploaded_prior_to=options.uploaded_prior_to,\n        )\n\n    def run(self, options: Values, args: list[str]) -> int:\n        cmdoptions.check_release_control_exclusive(options)\n\n        if options.outdated and options.uptodate:\n            raise CommandError(\"Options --outdated and --uptodate cannot be combined.\")\n\n        if options.outdated and options.list_format == \"freeze\":\n            raise CommandError(\n                \"List format 'freeze' cannot be used with the --outdated option.\"\n            )\n\n        cmdoptions.check_list_path_option(options)\n\n        packages: _ProcessedDists = [\n            cast(\"_DistWithLatestInfo\", d)\n            for d in get_environment(options.path).iter_installed_distributions(\n                local_only=options.local,\n                user_only=options.user,\n                editables_only=options.editable,\n                include_editables=options.include_editable,\n                skip=set(stdlib_pkgs),\n            )\n        ]\n\n        # get_not_required must be called firstly in order to find and\n        # filter out all dependencies correctly. Otherwise a package","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/pypa/pip/blob/f399c3718970b1b0e2478dac5296eb62679a9b86/src/pip/_internal/commands/list.py#L162-L198","documentation":"Raised by pip list when --outdated is combined with the freeze output format (--format freeze). The freeze format emits `name==version` lines intended for requirements files and has no concept of 'latest version' or up-to-date status, so reporting outdated packages in that format is meaningless. pip enforces this at the top of run() before doing any network work.","triggerScenarios":"Running `pip list --outdated --format freeze` or `pip freeze --outdated` (pip freeze delegates to the same code). Also reproducible if PIP_LIST_FORMAT=freeze and PIP_OUTDATED are both set in the environment.","commonSituations":"Trying to generate a requirements.txt of only outdated packages; piping `pip list --outdated` into a freeze-style script; misconfigured CI that sets both options.","solutions":["Use a non-freeze format for outdated listing: `pip list --outdated --format columns` or `--format json`.","If you need a machine-readable list of outdated packages, use `pip list --outdated --format json` and post-process.","Remove PIP_LIST_FORMAT from your environment or config if it is set to freeze while you also pass --outdated."],"exampleFix":"# before\npip list --outdated --format freeze\n# after\npip list --outdated --format json","handlingStrategy":"validation","validationCode":"def safe_pip_list(outdated: bool, fmt: str) -> list[str]:\n    if outdated and fmt == 'freeze':\n        raise ValueError('freeze format is incompatible with --outdated; use columns or json')\n    return ['pip', 'list', *(('--outdated',) if outdated else ()), f'--format={fmt}']\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use --format json for machine-readable outdated listings.","Never combine freeze with --outdated in generated commands."],"tags":["pip","list","cli","options","format"],"backgroundTag":null,"analyzedSha":"f399c3718970b1b0e2478dac5296eb62679a9b86","analyzedAt":"2026-08-08T23:01:42.227Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}