Why is precommit using a wrong Python version?
- 内容介绍
- 文章标签
- 相关推荐
本文共计398个文字,预计阅读时间需要2分钟。
Hi, I'm encountering an issue where the default Python on my system is 3.6.9, but pre-commit is using 13.6.0 for running hooks. Here's the output:python --versionPython 3.6.9python3.6Python
Hi,ImfacingthisissuewheremydefaultPythononmysystemisHi,
I'm facing this issue where my default Python on my system is
13.6.9, but pre-commit uses
13.6.0in running the hooks.
1234567➜ python --versionPython 3.6.9➜ python3.6Python 3.6.9 (default, Jun 12 2020, 10:30:48)[GCC 4.2.1 Compatible Apple LLVM 11.0.0 (clang-1100.0.33.17)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> exit()In my config, I pinned
1default_language_versionto
13.6, and I expected pre-commit to use the latest release version that I have, ie.
13.6.912345678default_language_version: python: python3.6repos: - repo: github.com/asottile/pyupgrade rev: v2.1.0 hooks: - id: pyupgrade args: [--py36-plus]However, pre-commit used
13.6.0instead, and threw the error below:
1234567891011121314➜ pre-commit run --all-files[INFO] Installing environment for github.com/asottile/pyupgrade.[INFO] Once installed this environment will be reused.[INFO] This may take a few minutes...An unexpected error has occurred: CalledProcessError: command: (/Users/blow/.cache/pre-commit/repo7_4ikr9y/py_env-python3.6/bin/python, -mpip, install, .)return code: 1expected return code: 0stdout: Processing /Users/blow/.cache/pre-commit/repo7_4ikr9ystderr: ERROR: Package pyupgrade requires a different Python: 3.6.0 not in >3.6.1Check the log at /Users/blow/.cache/pre-commit/pre-commit.logPinning
1python3.6.9for
1default_language_versionin the config solves this problem, but I want to be able to not pin release versions and just pin
1python3.6.
Am I doing something wrong in my setup? Appreciate the help.
该提问来源于开源项目:pre-commit/pre-commit
I resolved this by removing 3.6.0 from my machine. Thanks for your help and will close this now
本文共计398个文字,预计阅读时间需要2分钟。
Hi, I'm encountering an issue where the default Python on my system is 3.6.9, but pre-commit is using 13.6.0 for running hooks. Here's the output:python --versionPython 3.6.9python3.6Python
Hi,ImfacingthisissuewheremydefaultPythononmysystemisHi,
I'm facing this issue where my default Python on my system is
13.6.9, but pre-commit uses
13.6.0in running the hooks.
1234567➜ python --versionPython 3.6.9➜ python3.6Python 3.6.9 (default, Jun 12 2020, 10:30:48)[GCC 4.2.1 Compatible Apple LLVM 11.0.0 (clang-1100.0.33.17)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> exit()In my config, I pinned
1default_language_versionto
13.6, and I expected pre-commit to use the latest release version that I have, ie.
13.6.912345678default_language_version: python: python3.6repos: - repo: github.com/asottile/pyupgrade rev: v2.1.0 hooks: - id: pyupgrade args: [--py36-plus]However, pre-commit used
13.6.0instead, and threw the error below:
1234567891011121314➜ pre-commit run --all-files[INFO] Installing environment for github.com/asottile/pyupgrade.[INFO] Once installed this environment will be reused.[INFO] This may take a few minutes...An unexpected error has occurred: CalledProcessError: command: (/Users/blow/.cache/pre-commit/repo7_4ikr9y/py_env-python3.6/bin/python, -mpip, install, .)return code: 1expected return code: 0stdout: Processing /Users/blow/.cache/pre-commit/repo7_4ikr9ystderr: ERROR: Package pyupgrade requires a different Python: 3.6.0 not in >3.6.1Check the log at /Users/blow/.cache/pre-commit/pre-commit.logPinning
1python3.6.9for
1default_language_versionin the config solves this problem, but I want to be able to not pin release versions and just pin
1python3.6.
Am I doing something wrong in my setup? Appreciate the help.
该提问来源于开源项目:pre-commit/pre-commit
I resolved this by removing 3.6.0 from my machine. Thanks for your help and will close this now

