0

I'm trying to run dap-python to debug a Python file, but I get the following error:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  dap--create-session((:type "python" :cwd "/home/yelnat/Documents/programmin/python-test/" :request "launch" :name "My App" :program "/home/yelnat/Documents/programmin/python-test/test..." :args [] :dap-server-path (nil "-m" "debugpy.adapter")))
  dap-start-debugging-noexpand((:type "python" :cwd "/home/yelnat/Documents/programmin/python-test/" :request "launch" :name "My App" :program "/home/yelnat/Documents/programmin/python-test/test..." :args [] :dap-server-path (nil "-m" "debugpy.adapter")))
  #f(compiled-function () #<bytecode -0x785353ff795e90b>)()
  dap-debug((:type "python" :args "" :cwd "/home/yelnat/Documents/programmin/python-test/" :request "launch" :name "My App"))
  funcall-interactively(dap-debug (:type "python" :args "" :cwd "/home/yelnat/Documents/programmin/python-test/" :request "launch" :name "My App"))
  command-execute(dap-debug record)
  execute-extended-command(nil "dap-debug" "dap-deb")
  funcall-interactively(execute-extended-command nil "dap-debug" "dap-deb")
  command-execute(execute-extended-command)

I've tried a few different config files and I searched the dap website for an answer but I can't find it saying anything about where the dap-server should be.

The only thing that I think could be causing the issue is that I use Debian 12 and installed a version of Python 3.10 to install any system wide packages that I might want (packages like debugpy). I set up an alias for Python3.10 and use exec-path-from-shell, but I'm not sure if that'll affect dap-mode, so it might be using my python version that doesn't have debugpy.

Drew
  • 29,895
  • 7
  • 74
  • 104
Yelnat
  • 13
  • 3

1 Answers1

0

I've got a solution, but it's rather quick and dirty. I've just set a link from /bin/python to /bin/python3 (by doing sudo ln -s /bin/python3 /bin/python), which allows dap to find the python interpreter. If anyone knows a way to pass the path of the python interpreter to dap, that would probably be the best solution.

Yelnat
  • 13
  • 3