Repository navigation
Extension v2024.4.0 and v2024.4.1 create indefinite "Discover Python Interpreters" #23452
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
area-environmentsFeatures relating to handling interpreter environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugtriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Description
Type: Bug
Behaviour
Expected vs. Actual
Install v2024.4.0 or v2024.4.1 extension and the discovering Python interpreters run indefinitely. This also restarts the kernel periodically - a MAJOR PROBLEM when excecuting ML notebooks - lost variables imply retraining or reloading a pandas DF etc.
XXX
Steps to reproduce:
To stop the kernel from periodic restarts use v2024.2.1
Diagnostic data
- Python version (& distribution if applicable, e.g. Anaconda): 3.11.9
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
- Value of the
python.languageServersetting: Pylance
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
XXX
User Settings
languageServer: "Pylance"
Extension version: 2024.2.1
VS Code version: Code 1.88.0 (5c3e652f63e798a5ac2f31ffd0d863669328dc4c, 2024-04-03T13:28:09.495Z)
OS version: Darwin arm64 23.5.0
Modes:
System Info
| Item | Value |
|---|---|
| CPUs | Apple M1 Pro (10 x 24) |
| GPU Status | 2d_canvas: enabled canvas_oop_rasterization: enabled_on direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_graphite: disabled_off video_decode: enabled video_encode: enabled webgl: enabled webgl2: enabled webgpu: enabled |
| Load (avg) | 5, 5, 5 |
| Memory (System) | 16.00GB (0.05GB free) |
| Process Argv | --crash-reporter-id aaabbd8f-9170-4ae6-b93a-f11487600abe |
| Screen Reader | no |
| VM | 0% |
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
tftest:31042121
vswsl492cf:30256860
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pythonmypyd1:30879173
pythoncet0:30885854
2e7ec940:31000449
pythontbext0:30879054
accentitlementst:30995554
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
chatpanelc:31048052
dsvsc021:30996838
9c06g630:31013171
fchga941:31046352
pythonprc:31047982
dwnewjupytercf:31046870
26j00206:31048877
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-environmentsFeatures relating to handling interpreter environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugtriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Activity
anthonykim1 commentedon May 20, 2024
Hi Leo Pimentel (@dokutoshi). Thank you for filing the issue. Can you set your log level to trace in command palette and share your Python output info accessible in output for Python?
dcx commentedon May 21, 2024
I'm having this issue too, and there's nothing available in the Output dialog.
anthonykim1 commentedon May 22, 2024
Interesting..Does
Clear Cache and reload Python extensionfix the problem?(Accessible via ctrl+shift+p) or cmd+shift+p on mac.
anthonykim1 commentedon May 22, 2024
Also wondering if problem persists in version below v2024.4.0
dokutoshi commentedon Jun 1, 2024
dokutoshi commentedon Jun 4, 2024
Clearing the cache and reloading the window does solve the infinite running issue.
However, the reason i opened this ticket relates to this bug:
48 hours into testing,
Discovering process starts up and terminates a running job. ML training takes weeks. What happened? Using VSCode worked for over 2 years in DL training. Now I can barely use it for a day withoutDiscovering Python Interpreters appearing and halting training. Anthony Kim (@anthonykim1)anthonykim1 commentedon Jun 4, 2024
Leo Pimentel (@dokutoshi) Can you bring the requested logs and also check if same problem exists in version below 2024.4.0 that you have mentioned?
dokutoshi commentedon Jun 4, 2024
Dealing with a related issue in Vscode Insiders that crashes Pylance and triggers Discovering Python Interpreters.
note the error using the
-Iflag in the Vscode code base.Pylance Crash
For reference, here is the Python log output.
2024-06-04 18:31:35.095 [info] shell: bash
2024-06-04 18:31:35.732 [info] > /usr/bin/python -I ./.vscode-server-insiders/extensions/ms-python.python-2024.6.0/python_files/get_output_via_markers.py ./.vscode-server-insiders/extensions/ms-python.python-2024.6.0/python_files/interpreterInfo.py
2024-06-04 18:31:35.802 [info] > ./miniforge-pypy3/envs/tf_2.15/bin/python -I ./.vscode-server-insiders/extensions/ms-python.python-2024.6.0/python_files/get_output_via_markers.py ./.vscode-server-insiders/extensions/ms-python.python-2024.6.0/python_files/interpreterInfo.py
2024-06-04 18:31:35.816 [warning] [Error: Command failed: /usr/bin/python -I /home/ec2-user/.vscode-server-insiders/extensions/ms-python.python-2024.6.0/python_files/get_output_via_markers.py /home/ec2-user/.vscode-server-insiders/extensions/ms-python.python-2024.6.0/python_files/interpreterInfo.py
Unknown option: -I
usage: /usr/bin/python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.
code: 2,
killed: false,
signal: null,
cmd: '/usr/bin/python -I /home/ec2-user/.vscode-server-insiders/extensions/ms-python.python-2024.6.0/python_files/get_output_via_markers.py /home/ec2-user/.vscode-server-insiders/extensions/ms-python.python-2024.6.0/python_files/interpreterInfo.py'
}
2024-06-04 18:31:35.816 [error] Support for Python 2.7 has been dropped by the Python extension so certain features may not work, upgrade to using Python 3.
2024-06-04 18:31:35.843 [info] > /usr/bin/python ./.vscode-server-insiders/extensions/ms-python.python-2024.6.0/python_files/get_output_via_markers.py ./.vscode-server-insiders/extensions/ms-python.python-2024.6.0/python_files/interpreterInfo.py
2024-06-04 18:31:36.115 [info] > ./miniforge-pypy3/bin/python -I ./.vscode-server-insiders/extensions/ms-python.python-2024.6.0/python_files/get_output_via_markers.py ./.vscode-server-insiders/extensions/ms-python.python-2024.6.0/python_files/interpreterInfo.py
2024-06-04 18:31:36.279 [info] > /usr/local/bin/python -I ./.vscode-server-insiders/extensions/ms-python.python-2024.6.0/python_files/get_output_via_markers.py ./.vscode-server-insiders/extensions/ms-python.python-2024.6.0/python_files/interpreterInfo.py
2024-06-04 18:31:36.554 [info] Starting Pylance language server.
dokutoshi commentedon Jun 4, 2024
Sorry venting here but when the Discovery process starts, it is impossible to save the file.
Even Save As fails silently!
26 remaining items
karthiknadig commentedon Jul 1, 2024
Leo Pimentel (@dokutoshi) For long term we are going to switch to a different mechanism for discovery and one of the things we are seeing there is providing a way to exclude certain directories, in addition to improving the search performance.
dokutoshi commentedon Jul 1, 2024
Karthik Nadig (@karthiknadig) that would be most excellent. From a corporate perspective, the current limitation created the following situation:
These are significant changes at a corporate level . Ubuntu brings its own inherent limitations non-XFS etc that required further steps to support ML workflows.
dokutoshi commentedon Jul 16, 2024
the bot closed the open ticket after 3 days - that is too short a window - please adjust the bot.
Python Uncaught Error 2024.2.1](#23554 (comment))
Clearing the cache with each reload is standard practice.
One important test scenario:
Karthik Nadig (@karthiknadig) Don Jayamanne (@DonJayamanne)
I extended the workspace using "Add Folder to Workspace" to include a functional folder for TensorFlow.
For clarification:
The first folder contains Python source files and a notebook (a static folder).
The second folder (the TensorFlow folder) contains logs and metadata files generated by TensorFlow during training, typically per epoch, to save model weights and biases (a dynamic folder). PyTorch has a similar on-training file creation.
Post-observations after including a dynamic folder show that the growth in file count (less than 10 files) during an active kernel leads to a kernel halt. This is different, in my opinion, from including a large data directory with millions of images. In the dynamic folder case, behavior suggests that files added/created in an active workspace trigger the Python discovery process, interrupting an active kernel.
Best,
Leo
anthonykim1 commentedon Dec 9, 2024
Are you still able to repro this?

Also wondering if changing from native => js changes any behavior.
anthonykim1 commentedon Sep 9, 2025
Closing since there was no response for about a year. Feel free to ping me if occurs again. Thanks
amdokamal commentedon Jun 18, 2026
I am m seeing a very similar issue on Windows 11 with VS Code v1.125: simply opening a non-Python single file, such as a markdown file, triggers “Discovering Python Interpreters”. Disabling/uninstalling the Python extension stops the behavior.
This seems related to previously closed reports: