Search code examples
python-3.xpipenvpre-commit-hookpre-commitpre-commit.com

Uninstalled pre-commit preventing 'git commit' (pipenv)


I recently uninstalled pre-commit from my environment. I performed the following in pipenv:

pipenv --rm
<deleted Pipfile and Pipfile.lock>
pipenv install -r requirements.txt 

I ensured that the pre-commit module was no longer in the requirements.txt. When I make a git commit I get:

~/my_project/.venv/bin/python: No module named pre_commit

This is preventing me from committing, and I have no idea where this is coming from, since pre-commit is not being installed. Further, the traceback path specified is pointing to python and not python3. What am I missing?


Solution

  • There are still pre-commit hooks installed in your git repository. You can remove them by simply deleting .git/hooks/pre-commit in you repository, after which pre-commit won't be called anymore when commiting.