0

I'm a newbie to pre-commit. I'm trying to locally check a single python file I'd staged after I thought I'd had pre-commit installed on my PC (Windows 10) and properly installed in the directory. Here's what happens when I try to commit a file from the git bash shell:

$ git commit -m "test pre-commit"
black....................................................................Passed
reuse....................................................................Failed
- hook id: reuse
- exit code: 1

Traceback (most recent call last):
  File "C:\Users\mikem\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\mikem\Anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\mikem\.cache\pre-commit\repo8wyuxez6\py_env-python3\Scripts\reuse.EXE\__main__.py", line 4, in <module>
  File "c:\users\mikem\.cache\pre-commit\repo8wyuxez6\py_env-python3\lib\site-packages\reuse\_main.py", line 14, in <module>
    from . import (
  File "c:\users\mikem\.cache\pre-commit\repo8wyuxez6\py_env-python3\lib\site-packages\reuse\download.py", line 17, in <module>
    from ._util import (
  File "c:\users\mikem\.cache\pre-commit\repo8wyuxez6\py_env-python3\lib\site-packages\reuse\_util.py", line 26, in <module>
    from debian.copyright import Copyright
  File "c:\users\mikem\.cache\pre-commit\repo8wyuxez6\py_env-python3\lib\site-packages\debian\copyright.py", line 59, in <module>
    from debian import deb822
  File "c:\users\mikem\.cache\pre-commit\repo8wyuxez6\py_env-python3\lib\site-packages\debian\deb822.py", line 321, in <module>
    import debian.changelog
  File "c:\users\mikem\.cache\pre-commit\repo8wyuxez6\py_env-python3\lib\site-packages\debian\changelog.py", line 93, in <module>
    import pwd
ModuleNotFoundError: No module named 'pwd'

Check Yaml...........................................(no files to check)Skipped
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Passed
pylint (library code)....................................................Passed
pylint (examples code)...................................................Failed
- hook id: pylint_examples
- exit code: 1

Executable `/usr/bin/env` not found

Can someone explain what this means and how I fix it? Thanks!

anthony sottile
  • 61,815
  • 15
  • 148
  • 207
ViennaMike
  • 2,207
  • 1
  • 24
  • 38
  • 2
    [The module `pwd`](https://docs.python.org/3/library/pwd.html) is for Unix while you tried the code on w32. It seems you're using Unix-only code on w32. I see a directory `debian` which is surely Linux-only. – phd Apr 10 '21 at 21:33
  • fwiw I don't see that code in the latest version of their thing -- perhaps `pre-commit autoupdate` can get you to the latest version which doesn't have this problem any more ? – anthony sottile Apr 12 '21 at 02:19
  • Thanks! Not sure how I ended up with that version. In the end, I had other problems trying to work my updates in a Windows environment for an eventual non-Windows target (CircuitPython driver program update), so I just did everything in WSL. – ViennaMike Apr 13 '21 at 03:20

0 Answers0