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

Positron web: Python Interpreter Not Found #5286

Closed
testlabauto opened this issue Nov 6, 2024 · 2 comments
Closed

Positron web: Python Interpreter Not Found #5286

testlabauto opened this issue Nov 6, 2024 · 2 comments
Assignees

Comments

@testlabauto
Copy link
Contributor

testlabauto commented Nov 6, 2024

System details:

Positron and OS details:

Various versions, only seeing in web

Interpreter details:

Python 3.10.12

Describe the issue:

Error in logs when running various smoke tests

2024-10-31 17:57:34.766 [error] Creating session for language runtime c1579bebfca42fa8b57b884404993cb3 (language: Python name: Python 3.10.12 (Global) version: 3.10.12) failed. Reason: Error: Interpreter not found: /bin/python

2024-10-31 17:57:34.768 [error] Interpreter not found: /bin/python: Error: Interpreter not found: /bin/python
at new PythonRuntimeSession (/home/runner/work/positron/positron/extensions/positron-python/out/client/positron/session.js:70:19)
at PythonRuntimeManager.createSession (/home/runner/work/positron/positron/extensions/positron-python/out/client/positron/manager.js:144:16)
at async ExtHostLanguageRuntime.$createLanguageRuntimeSession (/home/runner/work/positron/positron/out/vs/workbench/api/common/positron/extHostLanguageRuntime.js:82:33)

sparklinesTrend.test.js.zip

Steps to reproduce the issue:

This happens periodically with Python smoke tests

Expected or desired behavior:

Valid interpreters are found

Were there any error messages in the UI, Output panel, or Developer Tools console?

ERR Creating session for language runtime c1579bebfca42fa8b57b884404993cb3 (language: Python name: Python 3.10.12 (Global) version: 3.10.12) failed. Reason: Error: Interpreter not found: /bin/python

@jmcphers
Copy link
Collaborator

Triage: This error is being logged from

const interpreter = interpreterService.getInterpreters().find((i) => i.id === extraData.pythonEnvironmentId);
if (!interpreter) {
throw new Error(`Interpreter not found: ${extraData.pythonEnvironmentId}`);
}
this.interpreter = interpreter;
. Maybe an issue w/ string equality or something changing the identifier we're comparing?

Let's add some logging here on the RHS/LHS of this check so we can figure out what's happening the next time we reproduce this.

@jmcphers jmcphers added this to the 2024.12.0 Pre-Release milestone Nov 12, 2024
@juliasilge juliasilge self-assigned this Nov 25, 2024
juliasilge added a commit that referenced this issue Nov 27, 2024
Addresses #5286 with some additional logging so we can start to
understand why we sometimes see this failure in smoke tests

### QA Notes

No changes for when the right Python interpreter _is_ found from the
`interpreterService`. If we again see this in tests, we should see
something like this in the Developer Tools console:

> ERR Interpreter
/Users/juliasilge/.pyenv/versions/3.11.7/envs/polars-testing/bin/python
not found in available Python interpreters:
/Users/juliasilge/.pyenv/versions/3.10.12/bin/python,/Users/juliasilge/.pyenv/versions/3.10.13/bin/python,/Users/juliasilge/.pyenv/versions/3.10.9/bin/python,/Users/juliasilge/.pyenv/versions/3.11.5/bin/python,/Users/juliasilge/.pyenv/versions/3.11.6/bin/python,/Users/juliasilge/.pyenv/versions/3.11.7/bin/python,/Users/juliasilge/.pyenv/versions/3.10.13/envs/bundle/bin/python,/Users/juliasilge/.pyenv/versions/3.10.12/envs/openai-testing/bin/python,/Users/juliasilge/.pyenv/versions/3.10.12/envs/positron/bin/python,/Users/juliasilge/.virtualenvs/r-tensorflow/bin/python,/usr/bin/python3,/Users/juliasilge/miniforge3/bin/python,/opt/homebrew/bin/python3.12,/Users/juliasilge/miniforge3/envs/emoji/bin/python,/Users/juliasilge/miniforge3/envs/keras-connect/bin/python,/Users/juliasilge/miniforge3/envs/my-first-pkg/bin/python,/Users/juliasilge/miniforge3/envs/pins-dev/bin/python,/Users/juliasilge/miniforge3/envs/test05-env/bin/python,/Users/juliasilge/miniforge3/envs/test06-env/bin/python,/Users/juliasilge/miniforge3/envs/tf_env/bin/python,/opt/homebrew/bin/python3.10,/opt/homebrew/bin/python3.11,/opt/homebrew/bin/python3.9,/Users/juliasilge/miniforge3/envs/another-test06-env/bin/python,/Users/juliasilge/.pyenv/versions/3.11.7/envs/positron-test-env/bin/python,

Kind of hard to read in a real situation, but seems like the best way
for us to find out what's going wrong occasionally in the tests is to
see all the interpreters the service thinks is there, plus what is was
looking for.

---------

Signed-off-by: Julia Silge <[email protected]>
Co-authored-by: sharon <[email protected]>
@juliasilge
Copy link
Contributor

There's no easy QA possible here for the change in logging, but we hope to use this better logging if/when we see this category of failure in Python smoke tests in the future. Let's plan to open a new issue in that case.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants