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.
しかし、エラーやログはまったく変更されませんでした。
これが何かわかる人いますか?そうでない場合は、うまくいけばすぐに解決し、答えを追加します... :)