Skip to content

Indicate to the user about any conda envs lacking an interpreter which do not use a valid python binary #18934

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

Closed
greazer opened this issue Apr 15, 2022 · 10 comments · Fixed by #19252
Assignees
Labels
area-environments Features relating to handling interpreter environments author-verification-requested Issues potentially verifiable by issue author feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@greazer
Copy link
Member

greazer commented Apr 15, 2022

Version: 1.67.0-insider (user setup)
Commit: a9288be
Date: 2022-04-15T05:16:11.219Z
Electron: 17.4.0
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Windows_NT x64 10.0.22593

Python (pre-release): v2022.5.11051003

Here's my conda env list:
image (8)

Here's the Select Interpreter list:
image (9)

Here's the log
MissingEnvironments.txt

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Apr 15, 2022
@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug triage area-environments Features relating to handling interpreter environments and removed triage-needed Needs assignment to the proper sub-team labels Apr 18, 2022
@karrtikr
Copy link

karrtikr commented Apr 18, 2022

@greazer Apologies for the issue, does this work in the stable release of the extension?

Unfortunately the logs aren't verbose enough atm, so I will soon create a new VSIX and post it here for you to try out.

@karrtikr karrtikr added info-needed Issue requires more information from poster investigating We are looking into the cause of the issue and removed triage labels Apr 18, 2022
@karrtikr
Copy link

karrtikr commented Apr 18, 2022

Here's the VSIX: https://github.com/microsoft/vscode-python/suites/6162882956/artifacts/215887730, please provide the logs again.

EDIT:

We discussed offline that the above VSIX fixes the bug, here's the log:

MissingEnvironments2.txt

@karrtikr karrtikr removed the info-needed Issue requires more information from poster label Apr 21, 2022
@karrtikr
Copy link

karrtikr commented Apr 22, 2022

However some of envs are invalid in the sense they do not contain a valid python binary. So they do not appear in the list.

Error: Command failed: C:\Users\jimg\anaconda3\Scripts\conda.exe run -n jupyter-lab-test-env --no-capture-output --live-stream python c:\Users\jimg\.vscode-insiders\extensions\ms-python.python-2022.5.2185428346-dev\pythonFiles\get_output_via_markers.py -c "import sys;print(sys.executable)"
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

It would be nice to somehow indicate this to the user that we did discover these so the conda env list matches with what the extension shows. Turning this into a feature request. This means we either:

  • Add support for selecting (and possibly fixing these envs).
  • Somehow indicate in the interpreter list that these envs are invalid.
  • Showing a notification on discovery, or even popping up a dialog box if the user happens to pick an invalid kernel, stating that it can't be used.

Blockers:

  • Internally it is always assumed an environment has an executable.
  • We currently validate all envs before displaying them in the list, make sure we skip any type of validation for these envs as they do not have a python binary we can run.

@karrtikr karrtikr added feature-request Request for new features or functionality needs PR and removed bug Issue identified by VS Code Team member as probable bug investigating We are looking into the cause of the issue labels Apr 22, 2022
@karrtikr karrtikr changed the title Conda environment list doesn't match interpreter list. Indicate to the user about any conda envs lacking an interpreter which do not use a valid python binary Apr 22, 2022
@greazer
Copy link
Member Author

greazer commented Apr 22, 2022

Sounds reasonable to me. Though that last sentence "We currently validate all envs before displaying them in the list". This is related to the conversation we had about a week ago where I believe you were going to experiment with not doing full "validation" (i.e. running the interpreter to get details) and see if anybody cares. I'd assume what that implies is that if an environment is shown in the quick pick and the user selects it, that's when "full validation" could be run. If it's unsuccessful, just tell the user and mark it as inaccessible somehow.

@karrtikr
Copy link

Interesting suggestion, will take that into consideration.

where I believe you were going to experiment with not doing full "validation" (i.e. running the interpreter to get details) and see if anybody cares

Just to clarify we actually the arrived to the idea that we'll be reporting the progress state in two phases, one before validating all envs and one after validation finishes, so "not validating experiment" is no longer needed 🙂 That however can change with this issue with your idea.

@brettcannon
Copy link
Member

One possibility is popping up a warning notification that the environment list is incomplete and to look at the Output panel for details of what got left out and why.

@luabud
Copy link
Member

luabud commented Apr 26, 2022

My 2 cents: If we don't display the interpreter, from the users perspective it may seem like there's a bug in the extension that caused discovery to fail. If we just warn them that the list is incomplete, there's not much they can do to get unblocked. But if we display it (even better alongside an e.g. ⚠️ icon indicating it's a problematic environment), we can show an notification once that is selected saying the binary is invalid and that the user needs to fix (and how wonderful would it be if we could also add a button to fix it? 👀)

@karrtikr
Copy link

karrtikr commented Jun 7, 2022

Add support for selecting (and possibly fixing these envs)

Went with the first solution in #18934 (comment): #18934 (comment)

Also added a ⚠️ icon next to it to indicate it's a problematic environment.

@rzhao271 rzhao271 added the verified Verification succeeded label Jun 29, 2022
@rzhao271
Copy link

I see the warning icon. Filed #19384 as a separate issue.

@karrtikr
Copy link

@greazer Can you verify that all envs reported via conda env list are reported? Regardless of whether they point to a valid python binary or not.

@karrtikr karrtikr added the author-verification-requested Issues potentially verifiable by issue author label Jun 29, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-environments Features relating to handling interpreter environments author-verification-requested Issues potentially verifiable by issue author feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants