Search code examples
pythonvisual-studio-codedebugging

Visual Studio Code debugging with python extension Version v2024.0.0 not working


I am working in Visual Studio Code (Version 1.86, details below) in Windows 10 (Version 10.0.19045 Build 19045) with Python. Since the last update of the Python extension (Version 2024.0.0) the debugging does not work for me. I tried the 'F5' button, but also the menu 'Run' > 'Start Debugging'. Neither works.

Then I tried Version v2023.22.1 for the Python extension and it works again. I assume that this does not occur for everyone. May question is, it that a bug of the current version, or am I doing something wrong? Did a default setting change, is it a incompatibility with my system or other extension?

VSC Version details:
Version: 1.86.0 (user setup)
Commit: 05047486b6df5eb8d44b2ecd70ea3bdf775fd937
Date: 2024-01-31T10:28:19.990Z
Electron: 27.2.3
ElectronBuildId: 26495564
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Windows_NT x64 10.0.19045

Solution

  • The debug bits of the Microsoft Python extension have been extracted to the Microsoft Python DebugPy extension. You can find the announcement here. Make sure the ms-python.debugpy extension is installed (it should be installed automatically as part of the Python extension update), and that it's enabled. If I remember correctly, it was disabled for me by default for some reason.

    You might need to create a launch config to use F5 to launch. See also https://stackoverflow.com/a/77937940/11107541.