No module named pre_commit
See original GitHub issueAfter updating to latest version, I got an error “No module named pre_commit” when git commit: Does anyone know how to fix it?
.nixpkgs
❯ pre-commit --version
pre-commit 2.16.0
.nixpkgs on master
❯ pre-commit install
pre-commit installed at .git/hooks/pre-commit
.nixpkgs on master
❯ pre-commit run --all-files
Check Toml...............................................................Passed
Check Yaml...............................................................Passed
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Passed
black....................................................................Passed
.nixpkgs on master
❯ git commit -m "Enable builtin pixel scrolling in Emacs 29"
/nix/store/x0fw0l4d6zwgfdwbpp23iwhm3c6a1hh3-python3-3.9.6/bin/python3.9: No module named pre_commit
I install pre-commit with nix on macOS.
This is my nix-config and .pre-commit-config.yaml
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
ModuleNotFoundError: No module named 'pre-commit'
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'pre-commit' How to remove the ModuleN.
Read more >Uninstalled pre-commit preventing 'git commit' (pipenv)
This is preventing me from committing, and I have no idea where this is coming from, since pre-commit is not being installed. Further,...
Read more >pre-commit
A framework for managing and maintaining multi-language pre-commit hooks. ... (optional) if true , this hook will run even if there are no...
Read more >pre-commit - PyPI
A framework for managing and maintaining multi-language pre-commit hooks.
Read more >tiangolo/fastapi - Gitter
Nevertheless, when I try to use add mypy in pre-commit I get this error: setup.cfg:27: error: Error importing plugin 'pydantic.mypy': No module named...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just in case someone stumble upon this. For me the solution during development was that I needed to install git hooks again in project.
After making myself sure that I was using the proper binaries. I was still having this issue until I ran:
pre-commit install
againsounds like a bug in the nix packaging – since that works fine elsewhere