{"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/d7d0d0a39494e28ec1c407bd0680e4a4d1067791/src/pip/_internal/cli/req_command.py#L434-L470","documentation":"Raised by RequirementCommand when an install/download/wheel call supplies no requirement (no positional arg, no -r/--editable/--dependency-groups/--requirements-from-scripts) but DOES supply --find-links. pip assumes the user intended the find-links entries themselves to be the packages and points them at the correct invocation: 'pip <name> <links>'.","triggerScenarios":"Running e.g. 'pip install --find-links ./wheels' with no package name after it; using a find-links directory as if it were a requirements source. The branch at req_command.py:451 is taken because options.find_links is truthy while the args/editables/requirements tuple is empty.","commonSituations":"Offline/airgapped installs where a local wheel directory was prepared but the package name was forgotten; typos like 'pip install --find-links ./dist' instead of 'pip install --no-index --find-links ./dist mypkg'; CI scripts that parameterize package names but emit an empty string.","solutions":["Add the package name(s) you want from the find-links dir: pip install --find-links ./wheels mypkg","If you meant 'install everything in this folder', there is no such command - enumerate the packages or build a requirements.txt listing them.","For a fully offline install add --no-index so pip does not fall back to PyPI: pip install --no-index --find-links ./wheels mypkg"],"exampleFix":"// before\npip install --find-links ./wheels\n// after\npip install --no-index --find-links ./wheels mypkg","handlingStrategy":"validation","validationCode":"if not packages and not requirements_files:\n    if find_links:\n        raise SystemExit(\n            \"No requirement given; to install from a find-links dir you must \"\n            \"also name the package, e.g. pip install --find-links ./wheels <pkg>\"\n        )\n    raise SystemExit(\"No requirement given\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair --find-links with an explicit package name (or --no-index plus a name).","In scripts, fail fast when a package-name variable resolves to empty."],"tags":["pip","cli","missing-argument","find-links","offline"],"analyzedSha":"d7d0d0a39494e28ec1c407bd0680e4a4d1067791","analyzedAt":"2026-08-04T20:55:04.259Z","schemaVersion":2}