In a personal repo, my latest attempt to commit was failing with a very generic appearing message:
/usr/bin/env python 3.9:
No such file or directory
What was really strange is that this repo wasn’t based on python version 3.9–at least not in recent memory–it was running on 3.11!
Come to find out, the problem actually had to do with pre-commit! And that made sense as the last time I’d worked on that repo on my personal laptop, I was probably running python 3.9 at the time… Running a couple commands to reset the pre-commit hook environment was all I needed to do to get my commit to work properly:
pre-commit clean
pre-commit autoupgrade