Python "tox: ERROR could not install deps" in CI
tox reports ERROR: could not install deps when the pip install for a test environment fails. The real cause is in the pip output above: an unresolvable requirement, an unreachable index, or a wheel build failure.
What this error means
A tox run ends with "ERROR: could not install deps [...]; v = InvocationError(...)" after pip output showing the underlying install failure.
python
ERROR: could not install deps [-r requirements.txt]; v = InvocationError('.../python -m pip install -r requirements.txt', 1)Common causes
An unresolvable or unreachable requirement
A pinned version does not exist, or a private index is unreachable from the tox env.
A dependency wheel failed to build inside the env
A package with no matching wheel tried to build from source and failed for missing toolchain.
How to fix it
Read the pip output and fix the deps list
- Scroll above the tox error to the pip output that names the failing package.
- Correct the requirement, add the index URL, or install the needed build toolchain in the env.
- Re-run with
tox -e <env> -vfor more detail if the cause is unclear.
Terminal
tox -e py311 -vHow to prevent it
- Validate requirements resolve before pushing.
- Provide index URLs/credentials to tox via passenv where needed.
- Prefer wheels and pin reproducible versions.
Related guides
Python "pytest-cov: no data was collected" in CIFix "CoverageWarning: No data was collected" with pytest-cov in CI - coverage measured nothing, usually a wro…
Python "ImportError: numpy built from source (no wheel for 3.13)" in CIFix numpy failing to build from source in CI on a Python version with no wheel yet (e.g. 3.13) - pip falls ba…
tox "ERROR: environment failed" in CIFix tox "ERROR: py312: failed" / "InvocationError" in CI - a tox environment's commands or setup returned non…