Skip to content

Failed to run hook: No such file or directory (os error 2) #675

@hynek

Description

@hynek

Hi,

this popular hook fails for me with this error:

$ uvx prek run --all-files -vvv ruff-check interrogate
DEBUG prek: 0.1.6 (2092da67d 2025-09-03)
DEBUG Git root: /Users/hynek/Work/vmws-manager
DEBUG Loading project configuration path=/Users/hynek/Work/vmws-manager/.pre-commit-config.yaml
TRACE Checking lock resource="store" path=/Users/hynek/.cache/prek/.lock
DEBUG Acquired lock resource="store"
DEBUG Hooks going to run: ["ruff-check", "interrogate"]
DEBUG Found installed environment for hook `ruff-check` at `/Users/hynek/.cache/prek/hooks/python-3s6AiFQXw77pGk55KtWq`
DEBUG Found installed environment for hook `interrogate` at `/Users/hynek/.cache/prek/hooks/python-nNAk2DSDC9Iy4QQJpQ1D`
TRACE Released lock path=/Users/hynek/.cache/prek/.lock
TRACE Executing `/usr/bin/git ls-files -z`
DEBUG All files in the repo: 145
TRACE Files after filtered: 145
TRACE Executing `/usr/bin/git diff`
ruff check...............................................................TRACE Resolved command: /Users/hynek/.cache/prek/hooks/python-3s6AiFQXw77pGk55KtWq/bin/ruff
TRACE Running ruff-check total_files=123 concurrency=1
TRACE Executing `/Users/hynek/.cache/prek/hooks/python-3s6AiFQXw77pGk55KtWq/bin/ruff check --force-exclude --fix --exit-non-zero-on-fix --unsafe-fixes tests/adapters/test_sqlany.py src/vmws_manager/features/ui_auth/services.py [...]`
TRACE Executing `/usr/bin/git diff`
Passed
- hook id: ruff-check
- duration: 0.04s
  All checks passed!
interrogate..............................................................TRACE Resolved command: interrogate
TRACE Running interrogate total_files=123 concurrency=1
TRACE Executing `interrogate tests tests/adapters/test_sqlany.py src/vmws_manager/features/ui_auth/services.py tests/features/domains/__init__.py [...]`
error: Failed to run hook `interrogate`
  caused by: run command `python hook` failed
  caused by: No such file or directory (os error 2)

Looking at the executing, I see that it doesn't prepend the path like it does for Ruff (see also TRACE Resolved command: interrogate vs TRACE Resolved command: /Users/hynek/.cache/prek/hooks/python-3s6AiFQXw77pGk55KtWq/bin/ruff). The only difference in their definitions that I can spot it the language_version: python3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions