Nic*_*ady 3 jupyterhub pre-commit.com
我正在尝试遵循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
Run Code Online (Sandbox Code Playgroud)
如果我检查日志,它是这样说的:
(.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)
Run Code Online (Sandbox Code Playgroud)
我试图清除缓存,因为它看起来像是在我使用 python 3.6 时可能存在的缓存
(.hub) {~/jupyter/jupyterhub} (master %)$ pre-commit clean
Cleaned /Users/nicholasbrady/.cache/pre-commit.
Run Code Online (Sandbox Code Playgroud)
但它根本没有改变错误或日志。
有谁知道这是什么吗?如果没有,希望我能尽快弄清楚,并在我这样做时添加答案...... :)
该存储库的配置设置language_version: python3.6这就是它尝试使用 python3.6 的原因
我建议将其更改为language_version: python3或安装python3.6
| 归档时间: |
|
| 查看次数: |
3168 次 |
| 最近记录: |