pythonvisual-studio-code

VSCode Python extension loading forever, saying “Reactivating terminals”


After updating VS code to v1.92, the Python extension consistently fails to launch, indefinitely showing a spinner next to “Reactivating terminals…” on the status bar.

Selecting OUTPUT > Python reveals the error Failed to resolve env "/mnt/data-linux/miniconda3".

Here’s the error trace:

2024-08-07 18:35:35.873 [error] sendStartupTelemetry() failed. s [Error]: Failed to resolve env "/mnt/data-linux/miniconda3"
    at ae (/home/user/.vscode-insiders/extensions/ms-python.python-2024.12.2-linux-x64/out/client/extension.js:2:1968174)
    at oe (/home/user/.vscode-insiders/extensions/ms-python.python-2024.12.2-linux-x64/out/client/extension.js:2:1966134)
    at Immediate.<anonymous> (/home/user/.vscode-insiders/extensions/ms-python.python-2024.12.2-linux-x64/out/client/extension.js:2:1962428)
    at processImmediate (node:internal/timers:478:21) {
  code: -4,
  data: undefined
}

How do I fix this? Restarting worked, but that's not sustainable.


Solution

  • This appears to be a bug related to the new "native" Python locator.

    You can go back to the old working version by adding the following line to the user settings JSON (until the bug in the native locator is fixed):

    "python.locator": "js",
    

    Note that this workaround pins you to the legacy version which is not something you'll want to have around forever so you might want to report your issue on Github at https://github.com/microsoft/vscode-python/issues.

    There've been many issues already filed and many solved but it's a work in progress. Example issues: