question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 3 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rkmcommented, Oct 16, 2020

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.

0reactions
asottilecommented, Nov 3, 2020

please don’t report here, report to virtualenv – thanks!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found