预提交 运行 路径 python3.6(来自 --python=python3.6)不存在
pre-commit run The path python3.6 (from --python=python3.6) does not exist
我正在尝试遵循 contributing docs for JupyterHub,但在 运行 pre-commit run
时出现错误
错误与我的 python 版本有关。出于某种原因,它期待 3.6
,即使所有的东西都是用 Python 3.7.3
安装的。这是 运行 命令的输出:
(.hub) {~/jupyter/jupyterhub} (master %)$ pre-commit run
[INFO] Initializing environment for https://github.com/asottile/reorder_python_imports.
[INFO] Initializing environment for https://github.com/ambv/black.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Installing environment for https://github.com/asottile/reorder_python_imports.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: Command: ('/Users/nicholasbrady/jupyter/jupyterhub/.hub/bin/python3', '-mvirtualenv', '/Users/nicholasbrady/.cache/pre-commit/repo5hv9ofak/py_env-python3.6', '-p', 'python3.6')
Return code: 3
Expected return code: 0
Output:
The path python3.6 (from --python=python3.6) does not exist
Errors: (none)
Check the log at /Users/nicholasbrady/.cache/pre-commit/pre-commit.log
如果我查看日志,它是这样写的:
(.hub) {~/jupyter/jupyterhub} (master %)$ cat /Users/nicholasbrady/.cache/pre-commit/pre-commit.log
An unexpected error has occurred: CalledProcessError: Command: ('/Users/nicholasbrady/jupyter/jupyterhub/.hub/bin/python3', '-mvirtualenv', '/Users/nicholasbrady/.cache/pre-commit/repo5hv9ofak/py_env-python3.6', '-p', 'python3.6')
Return code: 3
Expected return code: 0
Output:
The path python3.6 (from --python=python3.6) does not exist
Errors: (none)
Traceback (most recent call last):
File "/Users/nicholasbrady/jupyter/jupyterhub/.hub/lib/python3.7/site-packages/pre_commit/error_handler.py", line 46, in error_handler
yield
File "/Users/nicholasbrady/jupyter/jupyterhub/.hub/lib/python3.7/site-packages/pre_commit/main.py", line 316, in main
return run(args.config, store, args)
File "/Users/nicholasbrady/jupyter/jupyterhub/.hub/lib/python3.7/site-packages/pre_commit/commands/run.py", line 295, in run
install_hook_envs(hooks, store)
File "/Users/nicholasbrady/jupyter/jupyterhub/.hub/lib/python3.7/site-packages/pre_commit/repository.py", line 215, in install_hook_envs
hook.install()
File "/Users/nicholasbrady/jupyter/jupyterhub/.hub/lib/python3.7/site-packages/pre_commit/repository.py", line 93, in install
self.prefix, self.language_version, self.additional_dependencies,
File "/Users/nicholasbrady/jupyter/jupyterhub/.hub/lib/python3.7/site-packages/pre_commit/languages/python.py", line 168, in install_environment
_make_venv(env_dir, python)
File "/Users/nicholasbrady/jupyter/jupyterhub/.hub/lib/python3.7/site-packages/pre_commit/languages/python.py", line 180, in make_venv
cmd_output(*cmd, env=env, cwd='/')
File "/Users/nicholasbrady/jupyter/jupyterhub/.hub/lib/python3.7/site-packages/pre_commit/util.py", line 153, in cmd_output
returncode, cmd, retcode, output=(stdout, stderr),
pre_commit.util.CalledProcessError: Command: ('/Users/nicholasbrady/jupyter/jupyterhub/.hub/bin/python3', '-mvirtualenv', '/Users/nicholasbrady/.cache/pre-commit/repo5hv9ofak/py_env-python3.6', '-p', 'python3.6')
Return code: 3
Expected return code: 0
Output:
The path python3.6 (from --python=python3.6) does not exist
Errors: (none)
我试图清除缓存,因为它看起来像是指我拥有 python 3.6
时可能存在的缓存
(.hub) {~/jupyter/jupyterhub} (master %)$ pre-commit clean
Cleaned /Users/nicholasbrady/.cache/pre-commit.
但它根本没有改变错误或日志。
有人知道这是什么吗?如果没有,希望我会尽快弄清楚并在我做的时候添加一个答案......:)
该存储库的配置集 language_version: python3.6
这就是它尝试使用 python3.6
的原因
我建议将其更改为 language_version: python3
或安装 python3.6
我正在尝试遵循 contributing docs for JupyterHub,但在 运行 pre-commit run
错误与我的 python 版本有关。出于某种原因,它期待 3.6
,即使所有的东西都是用 Python 3.7.3
安装的。这是 运行 命令的输出:
(.hub) {~/jupyter/jupyterhub} (master %)$ pre-commit run
[INFO] Initializing environment for https://github.com/asottile/reorder_python_imports.
[INFO] Initializing environment for https://github.com/ambv/black.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Installing environment for https://github.com/asottile/reorder_python_imports.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: Command: ('/Users/nicholasbrady/jupyter/jupyterhub/.hub/bin/python3', '-mvirtualenv', '/Users/nicholasbrady/.cache/pre-commit/repo5hv9ofak/py_env-python3.6', '-p', 'python3.6')
Return code: 3
Expected return code: 0
Output:
The path python3.6 (from --python=python3.6) does not exist
Errors: (none)
Check the log at /Users/nicholasbrady/.cache/pre-commit/pre-commit.log
如果我查看日志,它是这样写的:
(.hub) {~/jupyter/jupyterhub} (master %)$ cat /Users/nicholasbrady/.cache/pre-commit/pre-commit.log
An unexpected error has occurred: CalledProcessError: Command: ('/Users/nicholasbrady/jupyter/jupyterhub/.hub/bin/python3', '-mvirtualenv', '/Users/nicholasbrady/.cache/pre-commit/repo5hv9ofak/py_env-python3.6', '-p', 'python3.6')
Return code: 3
Expected return code: 0
Output:
The path python3.6 (from --python=python3.6) does not exist
Errors: (none)
Traceback (most recent call last):
File "/Users/nicholasbrady/jupyter/jupyterhub/.hub/lib/python3.7/site-packages/pre_commit/error_handler.py", line 46, in error_handler
yield
File "/Users/nicholasbrady/jupyter/jupyterhub/.hub/lib/python3.7/site-packages/pre_commit/main.py", line 316, in main
return run(args.config, store, args)
File "/Users/nicholasbrady/jupyter/jupyterhub/.hub/lib/python3.7/site-packages/pre_commit/commands/run.py", line 295, in run
install_hook_envs(hooks, store)
File "/Users/nicholasbrady/jupyter/jupyterhub/.hub/lib/python3.7/site-packages/pre_commit/repository.py", line 215, in install_hook_envs
hook.install()
File "/Users/nicholasbrady/jupyter/jupyterhub/.hub/lib/python3.7/site-packages/pre_commit/repository.py", line 93, in install
self.prefix, self.language_version, self.additional_dependencies,
File "/Users/nicholasbrady/jupyter/jupyterhub/.hub/lib/python3.7/site-packages/pre_commit/languages/python.py", line 168, in install_environment
_make_venv(env_dir, python)
File "/Users/nicholasbrady/jupyter/jupyterhub/.hub/lib/python3.7/site-packages/pre_commit/languages/python.py", line 180, in make_venv
cmd_output(*cmd, env=env, cwd='/')
File "/Users/nicholasbrady/jupyter/jupyterhub/.hub/lib/python3.7/site-packages/pre_commit/util.py", line 153, in cmd_output
returncode, cmd, retcode, output=(stdout, stderr),
pre_commit.util.CalledProcessError: Command: ('/Users/nicholasbrady/jupyter/jupyterhub/.hub/bin/python3', '-mvirtualenv', '/Users/nicholasbrady/.cache/pre-commit/repo5hv9ofak/py_env-python3.6', '-p', 'python3.6')
Return code: 3
Expected return code: 0
Output:
The path python3.6 (from --python=python3.6) does not exist
Errors: (none)
我试图清除缓存,因为它看起来像是指我拥有 python 3.6
时可能存在的缓存(.hub) {~/jupyter/jupyterhub} (master %)$ pre-commit clean
Cleaned /Users/nicholasbrady/.cache/pre-commit.
但它根本没有改变错误或日志。
有人知道这是什么吗?如果没有,希望我会尽快弄清楚并在我做的时候添加一个答案......:)
该存储库的配置集 language_version: python3.6
这就是它尝试使用 python3.6
我建议将其更改为 language_version: python3
或安装 python3.6