Skip to content

Discovery runs conda info command multiple times during startup when large number of conda interpreters are present #18200

Closed

Description

@wubdub

VS Code version

1.63.0

Extension version

v2021.12.1559732655

OS type

macOS

OS version

11.4

Python distribution

Anaconda

Python version

3.8.5

Language server

Default

Expected behaviour

I would expect the extension to just use the already selected Python interpreter on the left and provide indexer features (like the ability to click through functions) on startup.
Screen Shot 2021-12-16 at 11 09 31 AM

Actual behaviour

The "Discovering Python Interpreters" dialog spins forever. If I go to "Output" and then select "Python" on the right drop down, the issue is the extension is looping through hundreds of python versions available on the cluster I am ssh'ing into.

For example, I see a constant output of the format, for everyone of hundreds of conda envs. I would just like to skip this discovering step and use the one I already selected.

> /home/XXX/.conda/envs/1e59305f3-855/bin/python ~/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/interpreterInfo.py
> conda info --json

Steps to reproduce

Have many python versions available in your conda env.

Logs

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    bugIssue identified by VS Code Team member as probable bug
    triage-neededNeeds assignment to the proper sub-team
    on Dec 16, 2021
  2. karrtikr commented on Dec 18, 2021

    @karrtikr

    provide indexer features (like the ability to click through functions) on startup.

    Is Discovery Interpreters somehow hindering this or your work?

  3. added
    area-environmentsFeatures relating to handling interpreter environments
    and removed
    triage-neededNeeds assignment to the proper sub-team
    on Dec 20, 2021
  4. brettcannon commented on Dec 20, 2021

    @brettcannon
    Member

    Was the environment previously selected for the workspace or was the terminal you launched VS Code from already activated? Or did you open a workspace with no environment selected and then you chose it (i.e. some form of discovery would have been required to find the environment regardless)?

  5. wubdub commented on Jan 4, 2022

    @wubdub
    Author

    Is Discovery Interpreters somehow hindering this or your work?

    Yes, during this time that "Discovering Python Interpreters" message is present the indexer does not work so I can't click on variables, click to go to function definitions, etc.

    Brett Cannon (@brettcannon), I set the "Default Interpreter Path" through this setting:
    Screen Shot 2022-01-04 at 9 35 58 AM

    To summarize, if "Default Interpreter Path" is set, I would expect "Discovering Python Interpreters" not to have run, which would then allow features related to the indexer to work instantly

  6. added
    investigatingWe are looking into the cause of the issue
    and removed
    info-neededIssue requires more information from poster
    on Jan 5, 2022
  7. karrtikr commented on Jan 5, 2022

    @karrtikr

    Yes, during this time that "Discovering Python Interpreters" message is present the indexer does not work so I can't click on variables, click to go to function definitions, etc.

    I see, can you provide me the logs as mentioned in the issue template during the message is present? I'm interested in the commands extension runs which particularly slows things down for you.

    Logs

    Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

    XXX
    

    Also, how long does 'conda info --json' command takes when run in terminal?

  8. 43 remaining items

  9. wubdub commented on Mar 10, 2022

    @wubdub
    Author

    Let me know how long does it take here to unblock you for using the above features. Also please provide the logs.

    Awesome!! The Pylance features are now nearly instantly available, works great!
    debug.txt

  10. karrtikr commented on Mar 10, 2022

    @karrtikr

    Fantastic 🥳 thanks for your help. We'll fix it soon with #18671, I'll fix the bug discovered here #18200 (comment) with this issue.

  11. changed the title [-]"Discovering Python Interpreters" runs through 100s of conda python versions every single time[/-] [+]"Discovering Python Interpreters" runs `conda info` command multiple times during startup when large number of conda interpreters are present[/+] on Mar 22, 2022
  12. changed the title [-]"Discovering Python Interpreters" runs `conda info` command multiple times during startup when large number of conda interpreters are present[/-] [+]Discovery runs `conda info` command multiple times during startup when large number of conda interpreters are present[/+] on Mar 22, 2022
  13. added
    bugIssue identified by VS Code Team member as probable bug
    and removed
    feature-requestRequest for new features or functionality
    on Mar 29, 2022
  14. kosarkazemi commented on Apr 13, 2022

    @kosarkazemi

    Hello,
    I am having this issue.
    What should I update?
    The page: https://github.com/microsoft/vscode-python/suites/5100759928/artifacts/152543360 is out of access now.

  15. karrtikr commented on Apr 13, 2022

    @karrtikr

    The fix is out in the latest stable release, so simply updating to the latest version of VSCode and extension should ideally fix it.

  16. wubdub commented on Apr 13, 2022

    @wubdub
    Author

    Kartik Raj (@karrtikr) I am actually running v2022.4.1 but the "Discovering Python Interpreters" continues to spin for a long time, printing out <various environment path>/bin/python ~/.vscode-server/extensions/ms-python.python-2022.4.1/pythonFiles/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2022.4.1/pythonFiles/interpreterInfo.py - perhaps this is a new issue I should file a ticket for?

  17. karrtikr commented on Apr 13, 2022

    @karrtikr

    This only fixes the issue that conda info command is only run once during startup. So discovery may still take longer and we may run interpreterInfo.py scripts but that is to be expected. Just make sure the same command isn't run twice.

    Thank you, just ran it, seemed to take about 5+ mins to load still

    Stable VSIX should bring you to this state you mentioned above.

    The fact that language server isn't started will be fixed by #18671.

  18. locked as resolved and limited conversation to collaborators on May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions