Pre-commit fails looking for python 3.6 interpreter in python 3.7.8 venv
See original GitHub issue
An unexpected error has occurred: CalledProcessError:
Command: ('/Users/as/.pyenv/versions/3.7.8/envs/ctixs/bin/python3.7', '-mvirtualenv', '/Users/as/.cache/pre-commit/repo2jxgpyes/py_env-python3.6', '-p', 'python3.6')
Return code: 1
Expected return code: 0
Output:
RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3.6'
Errors: (none)
Traceback (most recent call last):
File "/Users/as/.pyenv/versions/3.7.8/envs/ctixs/lib/python3.7/site-packages/pre_commit/error_handler.py", line 46, in error_handler
yield
File "/Users/as/.pyenv/versions/3.7.8/envs/ctixs/lib/python3.7/site-packages/pre_commit/main.py", line 316, in main
return run(args.config, store, args)
File "/Users/as/.pyenv/versions/3.7.8/envs/ctixs/lib/python3.7/site-packages/pre_commit/commands/run.py", line 295, in run
install_hook_envs(hooks, store)
File "/Users/as/.pyenv/versions/3.7.8/envs/ctixs/lib/python3.7/site-packages/pre_commit/repository.py", line 215, in install_hook_envs
hook.install()
File "/Users/as/.pyenv/versions/3.7.8/envs/ctixs/lib/python3.7/site-packages/pre_commit/repository.py", line 93, in install
self.prefix, self.language_version, self.additional_dependencies,
File "/Users/as/.pyenv/versions/3.7.8/envs/ctixs/lib/python3.7/site-packages/pre_commit/languages/python.py", line 161, in install_environment
_make_venv(env_dir, python)
File "/Users/as/.pyenv/versions/3.7.8/envs/ctixs/lib/python3.7/site-packages/pre_commit/languages/python.py", line 173, in make_venv
cmd_output(*cmd, env=env, cwd='/')
File "/Users/as/.pyenv/versions/3.7.8/envs/ctixs/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/as/.pyenv/versions/3.7.8/envs/ctixs/bin/python3.7', '-mvirtualenv', '/Users/as/.cache/pre-commit/repo2jxgpyes/py_env-python3.6', '-p', 'python3.6')
Return code: 1
Expected return code: 0
Output:
RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3.6'
Errors: (none)
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
pre-commit run The path python3.6 (from - Stack Overflow
The error is related to my python version. It's expecting 3.6 for some reason even though everything was installed with Python 3.7.3 ....
Read more >Supported hooks - pre-commit
reorder-python-imports - This hook reorders imports in python files. ... blacken-docs - Run `black` on python code blocks in documentation files ...
Read more >virtualenv - Release 20.4.7 unknown
The basic problem being addressed is one of dependencies and versions, ... virtualenv is a CLI tool that needs a Python interpreter to...
Read more >Python HOW: Using Poetry, Make, and pre-commit-hooks to ...
Run the setup target using make , and you are done! Three things have happened! An isolated .venv is created in the project's...
Read more >User Guide — Hypermodern Python Cookiecutter ...
Adding a Python-language hook. Running checks on modified files. Overview of pre-commit hooks. The Black hook. The Prettier hook. The Flake8 hook.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you post your full config, please? This seems similar to #1375, and I’ve also seen this myself when a hook is set to look for a different python version than is available.
please don’t report here, report to virtualenv – thanks!