{"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/d7d0d0a39494e28ec1c407bd0680e4a4d1067791/src/pip/_internal/commands/list.py#L162-L198","documentation":"Raised as CommandError in ListCommand.run() at list.py:179-182 when --outdated is combined with --format freeze. The freeze format emits 'name==version' requirement lines, which is incompatible with the extra Latest/Type columns that --outdated produces; pip forbids the combination to avoid ambiguous output.","triggerScenarios":"Running 'pip list -o --format freeze' or 'pip list --outdated --format=freeze'. The check at list.py:179 matches options.outdated and options.list_format == 'freeze'.","commonSituations":"Wanting a freeze-style list of only outdated packages; script authors combining the audit flag with the machine-friendly format.","solutions":["Use --format json with --outdated, which includes version AND latest_version fields.","Use --format columns (default) with --outdated to see the Latest/Type columns.","Drop --outdated if you specifically need freeze output."],"exampleFix":"# before\npip list --outdated --format freeze\n# after\npip list --outdated --format json","handlingStrategy":"validation","validationCode":"import sys\nfmt = None\nfor i,a in enumerate(sys.argv):\n    if a == '--format' and i+1 < len(sys.argv):\n        fmt = sys.argv[i+1]\n    elif a.startswith('--format='):\n        fmt = a.split('=',1)[1]\noutdated = ('--outdated' in sys.argv) or ('-o' in sys.argv)\nif outdated and fmt == 'freeze':\n    print('ERROR: --format freeze cannot be combined with --outdated; use --format json', file=sys.stderr)\n    sys.exit(2)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use --format json with --outdated for machine-readable output.","Reserve --format freeze for full environment snapshots without --outdated."],"tags":["pip","list","format","outdated","cli-argument-conflict"],"analyzedSha":"d7d0d0a39494e28ec1c407bd0680e4a4d1067791","analyzedAt":"2026-08-04T20:55:04.259Z","schemaVersion":2}