Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3.6' #1375

Closed
benjeffery opened this issue Mar 25, 2020 · 9 comments
Labels

Comments

@benjeffery
Copy link

Over at tskit-dev/tskit#498 a user has reported this error:

An unexpected error has occurred: CalledProcessError: command: ('/usr/bin/python3', '-mvirtualenv', '/home/peter/.cache/pre-commit/repoeh3i9c_u/py_env-python3.6', '-p', 'python3.6')
return code: 1
expected return code: 0
stdout:
    RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3.6'

Is this related to pypa/virtualenv#1515 ?

@benjeffery
Copy link
Author

Config at https://github.com/tskit-dev/tskit/blob/master/.pre-commit-config.yaml
Version 2.2.0

Seems adding language_version: python3.7 to the black config fixed this, as they didn't have python 3.6 on their system, but might that break people who have 3.6 only?

@asottile
Copy link
Member

this probably means they don't have python3.6 -- probably best to do language_version: python3 and then that should work for most that have a modern-enough python

@benjeffery
Copy link
Author

Brill - thanks for that!

@asottile
Copy link
Member

@gaborbernat -- just a data point, I think the old error message was easier to understand here:

$ virtualenv -p python3.6 vvv
The path python3.6 (from --python=python3.6) does not exist

vs

$ virtualenv -p python3.6 vvv
RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3.6'

@gaborbernat
Copy link

Well, in theory it's more accurate to say could not be found opposed to does not exists; because the executable might still be available on the machine, we could just not discover it because e.g. it's no on the PATH.

@asottile
Copy link
Member

yeah, perhaps just some wording can be rearranged, maybe something like this?

`python3.6` (from --python=python3.6) was not found while attempting Builtin discovery.

jugmac00 added a commit to jugmac00/Products.ZopeTree that referenced this issue Mar 2, 2021
RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3.6'

=> black was pinned to use Python 3.6 syntax, but it could not be found
on GHA.

Also see pre-commit/pre-commit#1375
@guilleijo
Copy link

guilleijo commented Mar 22, 2021

For anyone still having this problem, following @asottile recommendation of adding language_version: python3 in the conflicting repos works. In case that you need to add it in all repos and don't want to repeat the same line multiple times, you can add a global default.

default_language_version:
    python: python3

You can use a more specific version, in my case I'm using python: python3.7.

@khoulouda1996

This comment was marked as off-topic.

@asottile

This comment was marked as off-topic.

@pre-commit pre-commit locked as resolved and limited conversation to collaborators Apr 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

5 participants