Closed xuyastc closed 1 year ago
I suspect that mason doesn't install debugpy globally. So your /usr/local/bin/python3
interpreter can't find it.
Check the logs and install debugpy correctly. Either check mason docs or follow the wiki.
This is a bug tracker, not a support forum
Problem Statement
Why do I fail to debug python files? Please help me,tell me why why why
-- python config local dap = require('dap') dap.adapters.python = { type = "executable"; command = '/usr/local/bin/python3'; args = { '-m', 'debugpy.adapter' }; }
local get_args = function() local cmd_args = vim.fn.input('CommandLine Args:') local params = {} local sep = "%s" for param in string.gmatch(cmd_args, "[^%s]+") do table.insert(params, param) end return params end;
dap.configurations.python = { { type = 'python'; request = 'launch'; name = 'launch file'; program = '${file}'; args = get_args; pythonpath = function() return '/usr/local/bin/python3' end; }, }
Possible Solutions
No response
Considered Alternatives
No response