Skip to content

Can't debug; fails to read interpreter info from storage. Always "You need to select a Python interpreter..." #206293

@mnmkay

Description

@mnmkay

extensions:
Python v2024.0.0
Python Debugger v2024.0.0
(also isort v2023.10.1, Pylance v2023.12.1. never manually installed conda and the exe in not in PATH)
I've tried removing all ms-python.* folders in vscode extensions directory and reinstalled.

The issue and test case are as follows:
I create a new empty folder.
I place 1 empty .py file in it.
I open this folder as a workspace using File->Open Folder.
*** In the VSCode user data (workspaceStorage) folder this now creates a new subfolder with state.vscdb etc.

At this point I am able to run the python debugger on the empty .py file, with or without launch configuration. Never asked to select interpreter. I have 3 versions installed which it finds, 2 of which are >= 3.7. (as well dead location(s) of no-longer-installed versions that it tries to find with ENOENT error, according to Output/Python console). If I select either 3.7+ version manually (Python: Select Interpeter), either loads no problem; debugger command line run in PowerShell is: ".. <.../ms-python-debugpy-2024.0.0-win32-x64/..." etc. Extension seems to work fine.

The problem:
I now close the folder with File->Close Folder. I reopen the folder.
*** The workspaceStorage/state.vscdb now have pre-existed

I can no longer run the debugger. Any attempting to do so fails with dialog telling me "You need to select a Python interpreter...". I select one, but then always fails without running any shell, with dialog "Debug stopped." Even though the interpreter was selected in previous step or I select it again manually otherwise, it always asks again at the next attempt. It fails to read/store the selection.

However note that now, at any time, if I create a launch.json with the provided template then change the configuration type from "debugpy" back to "python", it will work with the version I have selected. PowerShell command is: ".. <.../ms-python-python-2024.0.0..."

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions