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

FindMatchingInterpreter matching on interpreter path #5650

Closed
Tracked by #6188 ...
IanMatthewHuff opened this issue Apr 27, 2021 · 6 comments
Closed
Tracked by #6188 ...

FindMatchingInterpreter matching on interpreter path #5650

IanMatthewHuff opened this issue Apr 27, 2021 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug notebook-execution Kernels issues (start/restart/switch/execution, install ipykernel) verified Verification succeeded
Milestone

Comments

@IanMatthewHuff
Copy link
Member

Noticed this in a semi-related PR here.

#5644 (review)

In FindMatchingInterpreter it's matching based on the path of the interpreter. I believe this might be an issue as "Interpreters" here is actually PythonEnvironments, and for Conda I believe you can have multiple environments with the same interpreter path if you don't specify the python version when creating the env.

@rchiodo
Copy link
Contributor

rchiodo commented Apr 29, 2021

We need to rethink how we uniquely identify PythonEnvironments.

@greazer
Copy link
Member

greazer commented Jun 4, 2021

We should add telemetry to see how many users fall into this category. Not necessary for June though.

@greazer greazer added the notebook-execution Kernels issues (start/restart/switch/execution, install ipykernel) label Jun 6, 2021
@IanMatthewHuff
Copy link
Member Author

Repro for this.

Create a conda env. Then you can create named conda kernelspec like this:
(dupe1) Ians-MacBook-Pro:~ ianhuff$ python -m ipykernel install --user --name dupeEnvUno --display-name "Dupe Env Uno"
Installed kernelspec dupeEnvUno in /Users/ianhuff/Library/Jupyter/kernels/dupeenvuno
(dupe1) Ians-MacBook-Pro:~ ianhuff$ python -m ipykernel install --user --name dupeEnvDos --display-name "Dupe Env Dos"
Installed kernelspec dupeEnvDos in /Users/ianhuff/Library/Jupyter/kernels/dupeenvdos

These will all get startUsingPythonInterpreter kernelConnectionMetadata and they will all have the same path. Find preferredKernel in helpers.ts matches only on path in a couple of places. If using old webview you run with "Dupe Env Uno" and save the file. The next time you open it you might get your kernel switched to the main conda env (dupe1) or "Dupe Env Dos" it's all ordering dependent.

The interactive window part usually works since the current interpreter is first in the list, so it usually gets matched before the other ones, but that is ordering dependent to some degree as well.

@greazer greazer modified the milestones: July 2021, August 2021 Jul 30, 2021
@greazer greazer added notebook-execution Kernels issues (start/restart/switch/execution, install ipykernel) and removed notebook-execution Kernels issues (start/restart/switch/execution, install ipykernel) labels Aug 2, 2021
@greazer greazer removed this from the August 2021 milestone Aug 3, 2021
@greazer greazer added the bug Issue identified by VS Code Team member as probable bug label Oct 9, 2021
@greazer greazer added this to the October 2021 milestone Oct 9, 2021
@rchiodo rchiodo modified the milestones: October 2021, November 2021 Oct 27, 2021
@rchiodo rchiodo modified the milestones: November 2021, January 2022 Dec 6, 2021
@rchiodo rchiodo self-assigned this Jan 20, 2022
@rchiodo
Copy link
Contributor

rchiodo commented Jan 20, 2022

FindMatchingInterpreter isn't used much anymore, but going to try and repro to see what the behavior is like.

@rchiodo
Copy link
Contributor

rchiodo commented Jan 20, 2022

These are just completely skipped now. Seems wrong to me? Kernelspec might have a custom env.

@rchiodo
Copy link
Contributor

rchiodo commented Jan 20, 2022

This works fine if the custom kernelspecs are any different than the default kernelspec.

@rchiodo rchiodo closed this as completed Jan 20, 2022
@IanMatthewHuff IanMatthewHuff added the verified Verification succeeded label Jan 28, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug notebook-execution Kernels issues (start/restart/switch/execution, install ipykernel) verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants