Open StrawberryGZ opened 1 week ago
Can you elaborate on what you mean by it does not work? Can you share a video or gif of the issue? Can you also sare the logs from Output > Python Debugger?
Also, try this:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"justMyCode": true, //只调试自己的Code
}
]
}
Hi, karthiknadig pls see the attachements, if u need anything pls let me know.
@StrawberryGZ In the video it looks like you have several configurations (green square below)
Select the first config then click on the gear icon. See if it opens the correct configuration.
as u can see, I don't think it is the problem of the configuration
Can you share the logs from Output > Python Debugger?
2024-10-18 14:57:06.733 [info] Resolving launch configuration with substituted variables 2024-10-18 14:57:06.742 [info] DAP Server launched with command: d:\softwares\anaconda\python c:\Users\Yanbo.Zhang7.vscode\extensions\ms-python.debugpy-2024.12.0-win32-x64\bundled\libs\debugpy\adapter
python debugger output logs are like this
If you see the screenshot of the logs here:
It looks like the extension is submitting the correct adapter path and python. It looks like debugpy is failing to start because you can see the brief moment of the debug session starting.
I suspect either a library shadowing issue or extension corruption.
@StrawberryGZ what does the terminal say? Running the debugger should output something in the terminal.
For me it does this:
PS C:\Users\rchiodo\source\testing\test_auto_import> & 'c:\Users\rchiodo\AppData\Local\Microsoft\WindowsApps\python3.11.exe' 'c:\Users\rchiodo\.vscode-insiders\extensions\ms-python.debugpy-2024.13.2024101501-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher' '62219' '--' 'C:\Users\rchiodo\source\testing\test_auto_import\app\db\test.py'
That will likely show whatever error is occurring.
@StrawberryGZ You can also try running this from the terminal:
d:\softwares\anaconda\python c:\Users\Yanbo.Zhang7\.vscode\extensions\ms-python.debugpy-2024.12.0-win32-x64\bundled\libs\debugpy\adapter
If there is any issue it will throw an error. If there are no issue then it will be blank. You can terminate the process using ctrl+c
.
@rchiodo If it fails before the DAP server has the opportunity to start then they might not see the terminal command. The above should indicate if something is failing before it can start the server. If that does not fail, then the next step is to manually launch the DAP server, using the debug server mode, and you can then connect to it from VS Code using debugServer in launch config. This way you can check if the server is starting independent of VS Code. Then launch config will then attach to the DAP server, from that point on it goes through the same process as regular launch. We use this to isolate issue between debugpy and the extension.
hi guys, I tried again. and nothing showed up in the terminal output. It seems debugger does not start.
Nothing shows up, not even the command?
This:
'c:\Users\rchiodo\AppData\Local\Microsoft\WindowsApps\python3.11.exe' 'c:\Users\rchiodo.vscode-insiders\extensions\ms-python.debugpy-2024.13.2024101501-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher' '62219' '--' 'C:\Users\rchiodo\source\testing\test_auto_import\app\db\test.py'
Like this.
What happens if you run the command yourself like @karthiknadig asked.
Run this from a terminal:
d:\softwares\anaconda\python c:\Users\Yanbo.Zhang7\.vscode\extensions\ms-python.debugpy-2024.12.0-win32-x64\bundled\libs\debugpy\adapter
sorry for the late response, it shows like this
Can you follow the directions here and upload the logs? https://github.com/microsoft/debugpy/wiki/Enable-debugger-logs
That should show the commands sent to the debugger and sent back to VS code. I suspect VS code is not getting the commands or is erroring when receiving them.
Hi guys,
I don't know why my debugger cannot be used. I tried to changed the python version from the latest one to 2022.4.0 and it still cannot work.
And I followed an instruction to change my launch.json to this:
vscode Version: 1.94.2 (user setup) python debugger: v2024.12.0 python: v2024.16.1 pylance: v2024.10.1
AND things aren't change, I still cannot use debugger, plsssssssss help!!!