-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No module named 'yaml' when run by pre-commit in VSCode git commit #702
Comments
This issue would be better looked at from the pre-commit side. You could try deleting and recreating the pre-commit environment. Take a look at #674 |
I've done that with no change. Tried also adding PyYAML as an additional dependency with no luck. Will check the pre-commit side. Likely there's some weird python version mismatch going on |
Running pip3 list in the .cache/pre-commit repo for yamllint does not show PyYAML as being installed. If I use that pip to install PyYAML, then the issue is resolved. It appears that the dependency for PyYAML isn't declared perhaps? |
It works for me with the following ---
repos:
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
- id: yamllint
args: [--strict] $ python3.12 -m venv .venv
$ source .venv/bin/activate
$ pip freeze # No PyYAML present
$ pip install pre-commit
$ pre-commit run --all-files
yamllint.................................................................Passed What version of yamllint are you targeting? |
pre-commit works fine when executed from cli on Mac.
However, when run via a commit within VSCode, getting
The text was updated successfully, but these errors were encountered: