我在安装预提交挂钩时遇到了障碍。根据下面的错误,挂钩安装在目录中找不到 python exe C:\\\\Users\\\\dangler\\\\.cache\\\\pre-commit\\\\repoith5dg7x\\\\py_env-default\\\\Scripts\\\\python.EXE(该文件夹中不存在 python.EXE...应该吗?)。我\xe2\x80\x99在过去的几个小时里一直在尝试解决它,但没有成功。希望有一个解决方案,也许我已经搜索了错误的地方。
(fiddle-env) PS C:\\Users\\dangler\\Documents\\projects\\fiddle> pre-commit clean\n(fiddle-env) PS C:\\Users\\dangler\\Documents\\projects\\fiddle> pre-commit install\n(fiddle-env) PS C:\\Users\\dangler\\Documents\\projects\\fiddle> git commit -am "README file with links"\n[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.\n[INFO] Once installed this environment will be reused.\n[INFO] This may take a few minutes...\nAn unexpected error has occurred: CalledProcessError: command: ('C:\\\\Users\\\\dangler\\\\.cache\\\\pre-commit\\\\repookmqanwy\\\\py_env-default\\\\Scripts\\\\python.EXE', '-mpip', 'install', '.')\nreturn code: 3221225781\nexpected return code: 0\nstdout: (none)\nstderr: (none)\nCheck the log at C:\\Users\\dangler\\.cache\\pre-commit\\pre-commit.log\nRun Code Online (Sandbox Code Playgroud)\n该.pre-commit-config.yml文件是这样的:
repos:\n- repo: https://github.com/pre-commit/pre-commit-hooks\n rev: v2.4.0\n hooks:\n - id: double-quote-string-fixer\n - id: check-added-large-files\n …Run Code Online (Sandbox Code Playgroud)