Skip to content

/errors/pip/invalid-requirement

pip: ERROR: Invalid requirement: 'requests=2.32.3'

verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash) · pip 26.2.1 fromupdated
tool
pip
exit code
1
versions
pip 23 – 26
os
any

ERROR: Invalid requirement: 'requests=2.32.3' means pip could not parse the requirement string. Here the cause is the single =: Python packaging has no = operator, so pip stops and suggests ==. Write pip install "requests==2.32.3" for an exact version, or a range like "requests>=2.32,<3".

Reproduce it

pip download parses requirements exactly like pip install, so it shows the same error without installing anything:

bash
pip download --disable-pip-version-check --no-deps -d dl "requests=2.32.3"

Output · exit 1

ERROR: Invalid requirement: 'requests=2.32.3': Expected semicolon (after name with no version specifier) or end
    requests=2.32.3
            ^
Hint: = is not a valid operator. Did you mean == ?

The caret points at the first character pip could not accept, and the Hint line names the fix.

Fix

bash
pip download --disable-pip-version-check --no-deps -q -d dl "six==1.16.0"
ls dl

Output

six-1.16.0-py2.py3-none-any.whl

Version operators

SpecifierMeaning
pkg==1.4.2Exactly 1.4.2
pkg==1.4.*Any 1.4.x release
pkg>=1.4,<2At least 1.4, below 2
pkg~=1.4.2Compatible release: >=1.4.2 and ==1.4.*
pkg!=1.5.0Any version except 1.5.0
pkg===1.4.2-customArbitrary string equality (rare; no version semantics)
pkg[extra]>=1.0With optional extras
pkg>=1.0; python_version < "3.11"Only on matching environments (environment marker)

Sources