VSCode Python extension loading forever, saying “Reactivating terminals”
Asked Answered
P

3

9

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.

Pardo answered 19/8, 2024 at 2:31 Comment(0)
P
11

Update: Extension version 2024.14.1 has likely fixed the issue. If you encounter this issue, rather than doing the workaround in the answer below, first try updating your extension as the workaround pins to legacy which is not something you'll want to have moving forward

This appears to be a bug related to the new "native" Python locator - I think VS Code recently switched more people from the old to the new 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",

There are already plenty of Github issues, hopefully a fix is on its way:

Pardo answered 19/8, 2024 at 2:31 Comment(4)
Hi Cornelius Roemer, glad to know you've found the solution to resolve this issue! you could click '✔' to mark it as an answer to change its status to Answered. It will also help others to solve a similar issue. See also can I answer my own question.. , Just a reminder :)Dace
@Dace I can only accept my own answer in 19 hours ;)Pardo
I am seeing this error on v2024.14.1Containment
Thanks @JamesHirschorn for letting me know, it would be great if you could provide debugging information for the developers here: github.com/microsoft/vscode-python/issues/23922Pardo
A
4

These steps solved my issue:

  • Open VS Code Settings
  • search for Python Locator
  • switch from native to js.
  • restart the vs code

vscodesettings

Authoritative answered 19/9, 2024 at 13:34 Comment(3)
That's the same as the accepted answer just using the UI instead of JSON. Thanks!Pardo
These steps were easier for a newbie to follow.Yardstick
@CorneliusRoemer i just copied from your answer(last issue issues/23956 link). thanksAuthoritative
P
0

The bug has been fixed in the Python extension version v2024.14.1 - so you just need to update the extension and reload the extension host.

Setting the locator to js is a workaround that pins to the legacy resolution method which will become less well supported over time. So updating is most likely the best solution for everyone now.

Here's how to update the python extension to the latest version*

enter image description here

Pardo answered 30/9, 2024 at 7:9 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.