Skip to content

debugger fails with uv setup + windows #178

Open
@user520881

Description

@user520881

I am running nvim-dap-python on nvim 0.9.5. OS is Windows and using debugpy as adapter.

when i try to run debugger on the uv's default main.py file i get the below error message in nvim. i have also included the dap logs and output from manually running debugpy in terminal below.

i think it is to do with a bad path "C:\Users<username>\uv-test2/.venv\Scripts\python.exe" (possibly double back slashes are required for windows? and there is one single forward slash) but maybe i am wrong. also shouldn't dap-python use pythonw.exe to avoid the terminal window pop up?

any help is appreciated.

	{
		"mfussenegger/nvim-dap",
		version = "*",
		dependencies = {
			"rcarriga/nvim-dap-ui",
			"nvim-neotest/nvim-nio",
			"folke/snacks.nvim",
			"theHamsta/nvim-dap-virtual-text",
			"mfussenegger/nvim-dap-python",
			"leoluz/nvim-dap-go",
		},
		config = function()
		
			local dap = require("dap")
			local dapui = require("dapui")
			dap.set_log_level("DEBUG")
			
			require("dapui").setup()
			require("nvim-dap-virtual-text").setup()
			require("dap-go").setup()

			require("dap-python").setup("uv")
		end,
	},

nvim error message

Error executing vim.schedule lua callback: Vim:E903: Process failed to start: function not implemented: "C:\Users\<username>\uv-test2/.venv\Scripts\python.exe"
stack traceback:
    [C]: in function 'jobstart'
    ...20881/nvim/nvim-data/lazy/nvim-dap/lua/dap/session.lua:300: in function 'handler'
    ...20881/nvim/nvim-data/lazy/nvim-dap/lua/dap/session.lua:1115: in function 'handle_body'
    ...20881/nvim/nvim-data/lazy/nvim-dap/lua/dap/session.lua:1619: in function 'cb'
    vim/_editor.lua:263: in function <vim/_editor.lua:262

Debug adapter didn't respond. Either the adapter is slow (then wait and ignore this) or there is a problem with your adapter or `python` configuration. Check the logs for errors (:help dap.set_log_level)
Press ENTER or type command to continue

logs

[DEBUG] 2025-03-29 22:41:30 dap/session.lua:1533	"Spawning debug adapter"	{
  args = { "run", "--with", "debugpy", "python", "-m", "debugpy.adapter" },
  command = "uv",
  enrich_config = <function 1>,
  options = {
    source_filetype = "python"
  },
  type = "executable"
}
[DEBUG] 2025-03-29 22:41:30 dap/session.lua:1872	"request"	{
  arguments = {
    adapterID = "nvim-dap",
    clientID = "neovim",
    clientName = "neovim",
    columnsStartAt1 = true,
    linesStartAt1 = true,
    locale = "en_US",
    pathFormat = "path",
    supportsProgressReporting = true,
    supportsRunInTerminalRequest = true,
    supportsStartDebuggingRequest = true,
    supportsVariableType = true
  },
  command = "initialize",
  seq = 1,
  type = "request"
}
[DEBUG] 2025-03-29 22:41:31 dap/session.lua:1068	1	{
  body = {
    category = "telemetry",
    data = {
      packageVersion = "1.8.13"
    },
    output = "ptvsd"
  },
  event = "output",
  seq = 1,
  type = "event"
}
[INFO] 2025-03-29 22:41:31 dap/session.lua:827	"Telemetry"	"ptvsd"
[DEBUG] 2025-03-29 22:41:31 dap/session.lua:1068	1	{
  body = {
    category = "telemetry",
    data = {
      packageVersion = "1.8.13"
    },
    output = "debugpy"
  },
  event = "output",
  seq = 2,
  type = "event"
}
[INFO] 2025-03-29 22:41:31 dap/session.lua:827	"Telemetry"	"debugpy"
[DEBUG] 2025-03-29 22:41:31 dap/session.lua:1068	1	{
  body = {
    exceptionBreakpointFilters = { {
        default = false,
        description = "Break whenever any exception is raised.",
        filter = "raised",
        label = "Raised Exceptions"
      }, {
        default = true,
        description = "Break when the process is exiting due to unhandled exception.",
        filter = "uncaught",
        label = "Uncaught Exceptions"
      }, {
        default = false,
        description = "Break when exception escapes into library code.",
        filter = "userUnhandled",
        label = "User Uncaught Exceptions"
      } },
    supportsClipboardContext = true,
    supportsCompletionsRequest = true,
    supportsConditionalBreakpoints = true,
    supportsConfigurationDoneRequest = true,
    supportsDebuggerProperties = true,
    supportsDelayedStackTraceLoading = true,
    supportsEvaluateForHovers = true,
    supportsExceptionInfoRequest = true,
    supportsExceptionOptions = true,
    supportsFunctionBreakpoints = true,
    supportsGotoTargetsRequest = true,
    supportsHitConditionalBreakpoints = true,
    supportsLogPoints = true,
    supportsModulesRequest = true,
    supportsSetExpression = true,
    supportsSetVariable = true,
    supportsStepInTargetsRequest = true,
    supportsTerminateDebuggee = true,
    supportsTerminateRequest = true,
    supportsValueFormattingOptions = true
  },
  command = "initialize",
  request_seq = 1,
  seq = 3,
  success = true,
  type = "response"
}
[DEBUG] 2025-03-29 22:41:31 dap/session.lua:1068	1	{
  body = {
    sockets = { {
        host = "127.0.0.1",
        internal = false,
        port = 58163
      } }
  },
  event = "debugpySockets",
  seq = 4,
  type = "event"
}
[DEBUG] 2025-03-29 22:41:31 dap/session.lua:1872	"request"	{
  arguments = {
    console = "integratedTerminal",
    name = "file",
    program = "C:\\Users\\W520881\\uv-test2\\main.py",
    pythonPath = "C:\\Users\\W520881\\uv-test2/.venv\\Scripts\\python.exe",
    request = "launch",
    type = "python"
  },
  command = "launch",
  seq = 2,
  type = "request"
}
[DEBUG] 2025-03-29 22:41:31 dap/session.lua:1068	1	{
  body = {
    sockets = { {
        host = "127.0.0.1",
        internal = false,
        port = 58163
      }, {
        host = "127.0.0.1",
        internal = true,
        port = 58164
      } }
  },
  event = "debugpySockets",
  seq = 5,
  type = "event"
}
[DEBUG] 2025-03-29 22:41:31 dap/session.lua:1068	1	{
  body = {
    sockets = { {
        host = "127.0.0.1",
        internal = false,
        port = 58163
      }, {
        host = "127.0.0.1",
        internal = true,
        port = 58165
      }, {
        host = "127.0.0.1",
        internal = true,
        port = 58164
      } }
  },
  event = "debugpySockets",
  seq = 6,
  type = "event"
}
[DEBUG] 2025-03-29 22:41:31 dap/session.lua:1068	1	{
  arguments = {
    args = { "C:\\Users\\W520881\\uv-test2/.venv\\Scripts\\python.exe", "C:\\Users\\W520881\\uv-test2\\.venv\\Lib\\site-packages\\debugpy\\launcher", "58165", "--", "C:\\Users\\W520881\\uv-test2\\main.py" },
    cwd = "C:\\Users\\W520881\\uv-test2",
    env = vim.empty_dict(),
    kind = "integrated",
    title = "Python Debug Console"
  },
  command = "runInTerminal",
  seq = 7,
  type = "request"
}
[DEBUG] 2025-03-29 22:41:31 dap/session.lua:230	"run_in_terminal"	{
  args = { "C:\\Users\\W520881\\uv-test2/.venv\\Scripts\\python.exe", "C:\\Users\\W520881\\uv-test2\\.venv\\Lib\\site-packages\\debugpy\\launcher", "58165", "--", "C:\\Users\\W520881\\uv-test2\\main.py" },
  cwd = "C:\\Users\\W520881\\uv-test2",
  env = vim.empty_dict(),
  kind = "integrated",
  title = "Python Debug Console"
}
[DEBUG] 2025-03-29 22:43:26 dap/session.lua:1068	1	{
  command = "launch",
  message = "Timed out waiting for launcher to connect",
  request_seq = 2,
  seq = 8,
  success = false,
  type = "response"
}
[DEBUG] 2025-03-29 22:43:26 dap/session.lua:1068	1	{
  body = {
    sockets = { {
        host = "127.0.0.1",
        internal = false,
        port = 58163
      }, {
        host = "127.0.0.1",
        internal = true,
        port = 58164
      } }
  },
  event = "debugpySockets",
  seq = 9,
  type = "event"
}

[INFO] 2025-03-29 22:56:04 dap/session.lua:1593	"Process exit"	"uv"	1	19320

output when running uv run --with debugpy python -m debugpy.adapter in terminal

$ uv run --with debugpy python -m debugpy.adapter
Content-Length: 138

{"seq": 1, "type": "event", "event": "output", "body": {"category": "telemetry", "output": "ptvsd", "data": {"packageVersion": "1.8.13"}}}Content-Length: 140
{"seq": 2, "type": "event", "event": "output", "body": {"category": "telemetry", "output": "debugpy", "data": {"packageVersion": "1.8.13"}}}Content-Length: 134

{"seq": 3, "type": "event", "event": "debugpySockets", "body": {"sockets": [{"host": "127.0.0.1", "port": 58741, "internal": false}]}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions