Skip to content

Extension v2024.4.0 and v2024.4.1 create indefinite "Discover Python Interpreters" #23452

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.languageServer setting: 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

Activity

  1. anthonykim1 commented on May 20, 2024

    @anthonykim1

    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?

    Screenshot 2024-05-20 at 11 40 13 AM Screenshot 2024-05-20 at 11 41 17 AM
  2. dcx commented on May 21, 2024

    @dcx

    I'm having this issue too, and there's nothing available in the Output dialog.

    image image
  3. anthonykim1 commented on May 22, 2024

    @anthonykim1

    Interesting..Does Clear Cache and reload Python extension fix the problem?
    (Accessible via ctrl+shift+p) or cmd+shift+p on mac.

  4. anthonykim1 commented on May 22, 2024

    @anthonykim1

    Also wondering if problem persists in version below v2024.4.0

  5. dokutoshi commented on Jun 1, 2024

    @dokutoshi
    Author
  6. dokutoshi commented on Jun 4, 2024

    @dokutoshi
    Author

    Clearing the cache and reloading the window does solve the infinite running issue.

    However, the reason i opened this ticket relates to this bug:

    image

    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 without Discovering Python Interpreters appearing and halting training. Anthony Kim (@anthonykim1)

  7. anthonykim1 commented on Jun 4, 2024

    @anthonykim1

    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?

  8. dokutoshi commented on Jun 4, 2024

    @dokutoshi
    Author

    Dealing with a related issue in Vscode Insiders that crashes Pylance and triggers Discovering Python Interpreters.
    note the error using the -I flag 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.

    at ChildProcess.exithandler (node:child_process:423:12)
    at ChildProcess.emit (node:events:530:35)
    at maybeClose (node:internal/child_process:1105:16)
    at Socket.<anonymous> (node:internal/child_process:457:11)
    at Socket.emit (node:events:518:28)
    at Pipe.<anonymous> (node:net:337:12)] {
    

    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.

  9. dokutoshi commented on Jun 4, 2024

    @dokutoshi
    Author

    Sorry venting here but when the Discovery process starts, it is impossible to save the file.

    Even Save As fails silently!

    image

  10. 26 remaining items

  11. karthiknadig commented on Jul 1, 2024

    @karthiknadig
    Member

    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.

  12. dokutoshi commented on Jul 1, 2024

    @dokutoshi
    Author

    Karthik Nadig (@karthiknadig) that would be most excellent. From a corporate perspective, the current limitation created the following situation:

    1. Migrate all AWS Linux 2 servers to Ubuntu as Linux 2 contains a python 2.7 env, albeit unused.
    2. Load only the source directory. Exclude Directories such as TF folders, parquet and csv data source, and other meta libraries from the workspace. In addition, data folders were included.

    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.

  13. dokutoshi commented on Jul 16, 2024

    @dokutoshi
    Author

    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

  14. anthonykim1 commented on Dec 9, 2024

    @anthonykim1

    Are you still able to repro this?
    Also wondering if changing from native => js changes any behavior.
    Image

  15. added
    area-environmentsFeatures relating to handling interpreter environments
    and removed
    info-neededIssue requires more information from poster
    on Dec 9, 2024
  16. anthonykim1 commented on Sep 9, 2025

    @anthonykim1

    Closing since there was no response for about a year. Feel free to ping me if occurs again. Thanks

  17. amdokamal commented on Jun 18, 2026

    @amdokamal

    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:

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 bugtriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions