HallerPatrick / py_lsp.nvim

Lsp Plugin for working with Python virtual environments
97 stars 11 forks source link

Spawning language server with cmd: `pylsp` failed. #30

Closed fbuys closed 1 year ago

fbuys commented 1 year ago

I am not sure how I can help debug this issue.

But I use lsp-zero and mason to install and configure lsp servers.

After adding py_lsp I see the following error when I open a python file with nvim.

Spawning language server with cmd: `pylsp` failed. The language server is either not installed, missing from PATH, or not executable.

The funny thing is that it does seem like the pyright lsp and the venv is activated.

Another curios thing is that the error message persists even after I remove py_lsp, which makes me wonder if py_lsp made a change somewhere that is not undone when you remove it.

Please let me know if I can run any debug steps on my side.

HallerPatrick commented 1 year ago

Hey!

The error is (I think) coming from vim.lsp or nvim-lspconfig itself. It seems that pylsp is not properly installed or not in PATH. Can you run pyslp in the terminal to see if it can be found outside of neovim?

py_lsp.nvim does not change any configurations or manipulates the PATH.

Can you maybe show me the relevant configurations?

fbuys commented 1 year ago

Hey!

I think the issue was caused by mason-lspconfig.

I followed these instructions and the error message disappeared. https://github.com/williamboman/mason-lspconfig.nvim/blob/84aff881ee525288297a381c6e5998ffddaa43ed/lua/mason-lspconfig/server_configurations/pylsp/README.md

So my diagnosis was incorrect, the error message was not caused by py_lsp

Thank you for this plugin and also responding so quickly 🎉