What This Error Means
You ran pip install without specifying a package name, a file/path, or -r requirements.txt.
How to Fix It
- Provide a package name:
python -m pip install <package>. - If you meant a requirements file:
python -m pip install -r requirements.txt. - If you meant a local project:
python -m pip install .(from the project root containingpyproject.tomlorsetup.py).
Why It Happens
- You ran
pip installwith no package names. - A script built the command incorrectly (empty variable or missing arguments).
- You meant to use
-r requirements.txtbut forgot-r.
How to Verify
- Re-run the corrected command and confirm pip starts downloading/installing packages.
- If using a script, add a guard that fails if the target variable is empty.
Manual argument checks
- Print the exact command your shell is running (especially in scripts/CI).
- If you're using variables, echo them to ensure they're not empty before calling pip.
Common CLI Output
ERROR: You must give at least one requirement to install (see "pip help install") How pip parses install targets
pip installrequires at least one "requirement specifier" (a package name likerequests, a wheel file, a VCS URL, or a requirements file with-r).- If all arguments are flags (or the target is empty due to shell expansion/scripting), pip stops with this error.
Prevention Tips
- In scripts, use
set -u(bash) or equivalent to catch empty variables. - Prefer explicit requirements files (
-r requirements.txt) for reproducible installs. - Keep install commands in one place (Makefile/script) to reduce typos.
Where This Can Be Triggered
github.com/pypa/pip/blob/25.3/src/pip/_internal/cli/req_command.py
pip raises a CommandError with "You must give at least one requirement ..." when pip install has no package args, editables, -r files, or dependency groups. - GitHub
if not (
args
or options.editables
or options.requirements
or options.dependency_groups
):
opts = {"name": self.name}
if options.find_links:
raise CommandError(
"You must give at least one requirement to {name} "
'(maybe you meant "pip {name} {links}"?)'.format(
**dict(opts, links=" ".join(options.find_links))
)
)
else:
raise CommandError(
"You must give at least one requirement to {name} "
'(see "pip help {name}")'.format(**opts)
)