Skip to content

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

Closed

Description

@greazer

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

Activity

  1. added
    triage-needed
    on Apr 15, 2022
  2. added
    bug
    area-environments
    and removed
    triage-needed
    on Apr 18, 2022
  3. karrtikr commented on Apr 18, 2022

    @karrtikr

    Jim Griesmer (@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.

  4. added
    info-needed
    investigating
    and removed on Apr 18, 2022
  5. karrtikr commented on Apr 18, 2022

    @karrtikr

    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

  6. removed
    info-needed
    on Apr 21, 2022
  7. karrtikr commented on Apr 22, 2022

    @karrtikr

    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.
  8. removed
    bug
    investigating
    on Apr 22, 2022
  9. 1 remaining item

  10. 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[/+] on Apr 22, 2022
  11. greazer commented on Apr 22, 2022

    @greazer
    Author

    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.

  12. karrtikr commented on Apr 22, 2022

    @karrtikr

    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.

  13. brettcannon commented on Apr 25, 2022

    @brettcannon
    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.

  14. luabud commented on Apr 26, 2022

    @luabud
    Member

    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? 👀)

  15. added
    verification-needed
    on Jun 7, 2022
  16. karrtikr commented on Jun 7, 2022

    @karrtikr

    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.

  17. rzhao271 commented on Jun 29, 2022

    @rzhao271

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

  18. karrtikr commented on Jun 29, 2022

    @karrtikr

    Jim Griesmer (@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.

  19. added
    author-verification-requested
    on Jun 29, 2022
  20. locked as resolved and limited conversation to collaborators on Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-environmentsauthor-verification-requestedfeature-requestverification-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions