Skip to content
Latchkey

pre-commit additional_dependencies not found in CI

additional_dependencies tells pre-commit to install extra packages into a hook environment (plugins, typing stubs). If one of those packages cannot be resolved or installed, the environment build fails and the hook never runs.

What this error means

The run fails while installing the hook environment with a resolution or download error for a package named in additional_dependencies.

pre-commit
An unexpected error has occurred: CalledProcessError:
command: install flake8-typo==9.9.9
return code: 1
ERROR: No matching distribution found for flake8-typo==9.9.9

Common causes

A pinned plugin version does not exist

An additional_dependencies entry pins a version that was never published, so the env install fails.

The plugin is private or offline

The package lives on a private index the hook environment cannot reach, so pip cannot install it.

How to fix it

Pin a published plugin version

  1. Read the failing install command in the pre-commit log.
  2. Correct the version to one the index publishes.
  3. Re-run so the environment builds.
.pre-commit-config.yaml
- repo: https://github.com/pycqa/flake8
  rev: 7.1.0
  hooks:
    - id: flake8
      additional_dependencies: ['flake8-bugbear==24.4.26']

Make private plugins reachable

Expose the private index credentials to the environment so the plugin installs.

.github/workflows/ci.yml
env:
  PIP_EXTRA_INDEX_URL: https://__token__:${{ secrets.PYPI_TOKEN }}@pypi.internal.example.com/simple

How to prevent it

  • Pin additional_dependencies to versions you have verified exist.
  • Cache PRE_COMMIT_HOME so a good env is not rebuilt every run.
  • Provide index credentials for private plugins in CI.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →