{"record":{"id":"f9675af38db8e09e","repo":"pypa/pip","slug":"you-must-give-at-least-one-requirement-to-name","errorCode":null,"errorMessage":"You must give at least one requirement to {name} (maybe you meant \"pip {name} {links}\"?)","messagePattern":"You must give at least one requirement to (.+?) \\(maybe you meant \"pip (.+?) (.+?)\"\\?\\)","errorType":"exception","errorClass":"CommandError","httpStatus":null,"severity":"error","filePath":"src/pip/_internal/cli/req_command.py","lineNumber":452,"sourceCode":"\n        # If any requirement has hash options, enable hash checking for all\n        # requirements, unless this mechanism has been explicitly disabled\n        # with --no-require-hashes.\n        if not options.no_require_hashes and any(\n            req.has_hash_options for req in requirements\n        ):\n            options.require_hashes = True\n\n        if not (\n            args\n            or options.editables\n            or options.requirements\n            or options.dependency_groups\n            or options.requirements_from_scripts\n        ):\n            opts = {\"name\": self.name}\n            if options.find_links:\n                raise CommandError(\n                    \"You must give at least one requirement to {name} \"\n                    '(maybe you meant \"pip {name} {links}\"?)'.format(\n                        **dict(opts, links=\" \".join(options.find_links))\n                    )\n                )\n            else:\n                raise CommandError(\n                    \"You must give at least one requirement to {name} \"\n                    '(see \"pip help {name}\")'.format(**opts)\n                )\n\n        return requirements\n\n    @staticmethod\n    def trace_basic_info(finder: PackageFinder) -> None:\n        \"\"\"\n        Trace basic information about the provided objects.\n        \"\"\"","sourceCodeStart":434,"sourceCodeEnd":470,"githubUrl":"https://github.com/pypa/pip/blob/f399c3718970b1b0e2478dac5296eb62679a9b86/src/pip/_internal/cli/req_command.py#L434-L470","documentation":"Raised as CommandError in RequirementCommand.get_requirements (req_command.py:452) when no requirement source was provided (no args, no -e, no -r, no --group, no --requirements-from-script per the check at lines 443-449) BUT options.find_links is non-empty. Because find-links are sources, not things to install, pip assumes the user forgot the package name and helpfully suggests `pip <name> <links>` so they can discover and install from that index.","triggerScenarios":"`pip install --find-links /opt/wheels` with no package argument; `pip install -f https://my.index/` alone.","commonSituations":"Setting up a private wheelhouse and forgetting to name the package; expecting find-links to install everything in the directory.","solutions":["Add the package name(s) to install: `pip install --find-links /opt/wheels <pkg>`.","If unsure of available packages, run `pip install --find-links /opt/wheels --dry-run <guess>` or list the directory contents."],"exampleFix":"# before\npip install --find-links /opt/wheels\n# after\npip install --find-links /opt/wheels requests","handlingStrategy":"validation","validationCode":"# Require at least one install target whenever find-links is set.\ndef validate_install_targets(opts, packages):\n    has_src = bool(packages or opts.get(\"editables\") or opts.get(\"requirements\") or opts.get(\"group\") or opts.get(\"requirements_from_scripts\"))\n    if opts.get(\"find_links\") and not has_src:\n        raise ValueError(\"--find-links needs a package name to install\")\n    return True","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember --find-links is an index source, not an install target; always name the package."],"tags":["cli-options","requirements","find-links","command-error"],"backgroundTag":null,"analyzedSha":"f399c3718970b1b0e2478dac5296eb62679a9b86","analyzedAt":"2026-08-08T23:01:42.227Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}