toot by https://mastodon.world/@orizuru
mastodon.world/@orizuru/111966059278729032[@rob](https://gts.cupcakerob.nl/@rob)
If you use poetry to manage your venv for each repo, you can also do: poetry shell
to use start the virtualenv, and then run nvim .
to start coding.
Provided that your dap is setup like this:
local dap = require("dap")
dap.configurations.python = {
{
type = "python",
request = "launch",
name = "Launch file",
program = "${file}",
pythonPath = "python",
},
}
[#nvim](https://mastodon.world/tags/nvim) [#neovim](https://mastodon.world/tags/neovim) [#python](https://mastodon.world/tags/python)
toot by https://gts.cupcakerob.nl/@rob
gts.cupcakerob.nl/@rob/statuses/01HQ44GMQ4QTAV8EVDSGJHFDXZ
TIL: if I want to debug [#python](https://gts.cupcakerob.nl/tags/python) :python: in [#neovim](https://gts.cupcakerob.nl/tags/neovim) :nvim:
your imported packages need to be in the same python env that debugpy is.
Now in [#LazyVim](https://gts.cupcakerob.nl/tags/lazyvim) , [#mason](https://gts.cupcakerob.nl/tags/mason) installs debugpy in it's own venv and the debug adapter can't find the other packages
so: install debugpy in your venv and run
:lua require('dap-python').setup('./venv/bin/python')
or use vscode/pycharm or something if you have a life ;-)