-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't debug; fails to read interpreter info from storage. Always "You need to select a Python interpreter..." #206293
Comments
Luckily I've tracked it down to this unrelated setting. I remove it before VSCode starts and the problem goes away and I can debug now. I have Microsoft C/C++ extension installed.
I'm having another random inexplicable problem that I hope also goes away by this. Looks like experimental affinity is indeed an invitation for strange problems. |
I'm also affected by this problem. With default settings and otherwise new workspace I'm always running into "You need to select a Python interpreter...". I'm working on Manjaro and have tried both the stable and pre-release versions of the Python extension. For me the aforementioned solutions didn't work alone. What somewhat worked for me was to:
Doing only one of both things is not sufficient. I have no other extensions installed. I also noticed that the issue doesn't appear when installing the Python extension during a VSCode session. Would be happy to supply more info if helpful since this problem is really breaking for me. |
After writing the previous comment I tried something else:
After restarting vscode everything now works as expected (even with |
Thanks @mmaeusezahl it looks like an issue in vscode, ill transfer the issue to them. |
@mmaeusezahl , I had the same issue, turns out you don't need to completely remove the $HOME/.config/Code/ folder. |
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..."
The text was updated successfully, but these errors were encountered: