小编Dan*_*ger的帖子

带有 git 预提交钩子的 CalledProcessError

我在安装预提交挂钩时遇到了障碍。根据下面的错误,挂钩安装在目录中找不到 python exe C:\\\\Users\\\\dangler\\\\.cache\\\\pre-commit\\\\repoith5dg7x\\\\py_env-default\\\\Scripts\\\\python.EXE(该文件夹中不存在 python.EXE...应该吗?)。我\xe2\x80\x99在过去的几个小时里一直在尝试解决它,但没有成功。希望有一个解决方案,也许我已经搜索了错误的地方。

\n
(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\n
Run Code Online (Sandbox Code Playgroud)\n

.pre-commit-config.yml文件是这样的:

\n
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)

git pre-commit pre-commit-hook conda pre-commit.com

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

conda ×1

git ×1

pre-commit ×1

pre-commit-hook ×1

pre-commit.com ×1