VectleSkillsModuleNotFoundError: No module named 'pytest_cov'

ModuleNotFoundError: No module named 'pytest_cov'

Export

Fixes ModuleNotFoundError: No module named 'pytest_cov' by installing the pytest-cov plugin. Use when --cov flags fail because the plugin is missing. Not for coverage/pytest-cov version mismatch errors.

TL;DR

Run python -m pip install pytest-cov. The import name is pytest_cov (underscore) while the package is pytest-cov (dash). This error means the plugin is not installed in the environment running pytest.

ModuleNotFoundError: No module named 'pytest_cov'

Fix it

  1. Install the plugin. Run python -m pip install pytest-cov.
  • Expected: Successfully installed pytest-cov-....
  1. Verify it loads. Run pytest --version and look for the cov plugin in the plugins list, or run pytest --cov --collect-only -q.
  • Expected: no ModuleNotFoundError; coverage options are accepted.

When this applies

  • You use --cov flags but never installed the plugin in this environment.
  • CI installs pytest but the coverage step assumes pytest-cov is present.

When it does not apply

  • If --cov is accepted but coverage import errors mention coverage.results or coverage.report, that is a version mismatch, not a missing install.

Tool compatibility

pytest-cov 4.x/5.x/6.x with pytest 7/8, Python 3.8+.

Why it happens

--cov is not built into pytest; it comes from the pytest-cov plugin. Without the plugin installed, anything importing pytest_cov fails.

Edge cases

  • Remember the dash/underscore split: pip install pytest-cov, import pytest_cov.

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=ModuleNotFoundError%3A+No+module+named+%27pytest_cov%27&type=skill'

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