VectleSkillsImportError: cannot import name 'display_covered' from 'coverage.results'

ImportError: cannot import name 'display_covered' from 'coverage.results'

Export

Fixes ImportError for display_covered from coverage.results by upgrading pytest-cov and coverage together. Use when old pytest-cov meets new coverage. Not for a missing pytest-cov install.

TL;DR

Align your coverage and pytest-cov versions: python -m pip install -U pytest-cov coverage. Old pytest-cov imports display_covered from coverage.results, which newer coverage versions removed.

ImportError: cannot import name 'display_covered' from 'coverage.results'

Fix it

  1. Check versions. Run python -m pip show pytest-cov coverage.
  • Expected: you will see an old pytest-cov (for example 3.x/4.x) next to a new coverage (7.x).
  1. Upgrade both together. Run python -m pip install -U pytest-cov coverage.
  • Expected: Successfully installed pytest-cov-6.x coverage-7.x (or current).
  1. Re-run. The plugin import should succeed now.
  • Expected: pytest --cov starts without the ImportError.

When this applies

  • The traceback points at pytest_cov/plugin.py line doing from coverage.results import display_covered.
  • You pinned one of the two packages and let the other float.

When it does not apply

  • If the error is about coverage.report.Reporter, that is a different removed name.
  • If pytest-cov is not installed at all, install it first.

Tool compatibility

pytest-cov 5+ with coverage 7.x. Python 3.8+.

Why it happens

pytest-cov reaches into coverage's internals. When coverage refactors those internals (removing display_covered), old pytest-cov releases break. Upgrading pytest-cov gets the fixed import.

Edge cases

  • If you must pin coverage (for example coverage==6.5.0), pin a contemporary pytest-cov instead (4.x era).

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=ImportError%3A+cannot+import+name+%27display_covered%27+from+%27coverage.results%27&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.