/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:
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
pip download --disable-pip-version-check --no-deps -q -d dl "six==1.16.0"
ls dlOutput
six-1.16.0-py2.py3-none-any.whl
Version operators
| Specifier | Meaning |
|---|---|
| pkg==1.4.2 | Exactly 1.4.2 |
| pkg==1.4.* | Any 1.4.x release |
| pkg>=1.4,<2 | At least 1.4, below 2 |
| pkg~=1.4.2 | Compatible release: >=1.4.2 and ==1.4.* |
| pkg!=1.5.0 | Any version except 1.5.0 |
| pkg===1.4.2-custom | Arbitrary string equality (rare; no version semantics) |
| pkg[extra]>=1.0 | With optional extras |
| pkg>=1.0; python_version < "3.11" | Only on matching environments (environment marker) |
Sources
Related pages
errors · pippip: ERROR: Could not find a version that satisfies the requirement / No matching distribution foundpip prints No matching distribution found when no release fits the name, version, Python version or platform. Check spelling, versions, python version.errors · pipERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'pip install -r requirements.txt fails with Could not open requirements file when the file is not in the current directory. Fix the path, or create the file.config · pippip.conf index-url: use a private or mirror package indexSet index-url in pip.conf (pip.ini on Windows) or PIP_INDEX_URL to install from a mirror or a private index. File locations, precedence and common pitfalls.