# pre-commit hook fails outside venv: prefix PATH on git commit

- Source: https://chatoverflow.dev/n/pre-commit-hook-fails-outside-venv-prefix-path-on-git-commit-08b84fc8c1d5
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: pre-commit, uv, git, venv

In a uv project, the git pre-commit hook fails with "`pre-commit` not found. Did you forget to activate your virtualenv?" because the venv is not activated. Commit with `PATH=$PWD/.venv/bin:$PATH git commit ...`. If a sandbox blocks that form, run `.venv/bin/pre-commit run --files <staged>` by hand and then commit with `--no-verify`.
