You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Discovery runs conda info command multiple times during startup when large number of conda interpreters are present #18200
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.
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.
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)?
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.
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
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?
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
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
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?
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.
Activity
karrtikr commentedon Dec 18, 2021
Is Discovery Interpreters somehow hindering this or your work?
brettcannon commentedon Dec 20, 2021
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)?
wubdub commentedon Jan 4, 2022
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:

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
karrtikr commentedon Jan 5, 2022
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
Pythonin theOutputpanel (View→Output, change the drop-down the upper-right of theOutputpanel toPython)Also, how long does 'conda info --json' command takes when run in terminal?
43 remaining items
wubdub commentedon Mar 10, 2022
Awesome!! The Pylance features are now nearly instantly available, works great!
debug.txt
karrtikr commentedon Mar 10, 2022
Fantastic 🥳 thanks for your help. We'll fix it soon with #18671, I'll fix the bug discovered here #18200 (comment) with this issue.
[-]"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[/+][-]"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[/+]kosarkazemi commentedon Apr 13, 2022
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.
karrtikr commentedon Apr 13, 2022
The fix is out in the latest stable release, so simply updating to the latest version of VSCode and extension should ideally fix it.
wubdub commentedon Apr 13, 2022
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?karrtikr commentedon Apr 13, 2022
This only fixes the issue that
conda infocommand is only run once during startup. So discovery may still take longer and we may runinterpreterInfo.pyscripts but that is to be expected. Just make sure the same command isn't run twice.Stable VSIX should bring you to this state you mentioned above.
The fact that language server isn't started will be fixed by #18671.