Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jedi-language-server crashes right after start with failed import #302

Closed
igordertigor opened this issue Feb 6, 2024 · 2 comments
Closed

Comments

@igordertigor
Copy link

I'm using jedi-language-server with neovim's nvchad config. The relevant configuration is:

local config = require("plugins.configs.lspconfig")

local on_attach = config.on_attach
local capabilities = config.capabilities

local lspconfig = require("lspconfig")

lspconfig.jedi_language_server.setup{
  on_attach = on_attach,
  capabilities = capabilities,
  filetypes = {"python"},
}

jedi-language-server is installed using mason.

Right after startup, jedi fails with the following error message (replacing \n by actual line breaks and my home dir by ~ for readability / shorter line length):

[ERROR][2024-02-06 10:50:30] .../vim/lsp/rpc.lua:31	"rpc"	"~/.local/share/nvim/mason/bin/jedi-language-server"	"stderr"	"Traceback (most recent call last):
  File \"~/.local/share/nvim/mason/bin/jedi-language-server\", line 5, in <module>
    from jedi_language_server.cli import cli
  File \"~/.local/share/nvim/mason/packages/jedi-language-server/venv/lib/python3.8/site-packages/jedi_language_server/cli.py\", line 8, in <module>
    from .server import SERVER
  File \"~/.local/share/nvim/mason/packages/jedi-language-server/venv/lib/python3.8/site-packages/jedi_language_server/server.py\", line 68, in <module>
    from pygls.protocol import LanguageServerProtocol, lsp_method
  File \"~/.local/share/nvim/mason/packages/jedi-language-server/venv/lib/python3.8/site-packages/pygls/protocol/__init__.py\", line 14, in <module>
    from pygls.protocol.language_server import LanguageServerProtocol, lsp_method
  File \"~/.local/share/nvim/mason/packages/jedi-language-server/venv/lib/python3.8/site-packages/pygls/protocol/language_server.py\", line 64, in <module>
    from lsprotocol.types import (
ImportError: cannot import name 'TraceValues' from 'lsprotocol.types' (~/.local/share/nvim/mason/packages/jedi-language-server/venv/lib/python3.8/site-packages/lsprotocol/types.py)
"

How can I fix this? How can I further debug this? Is anything wrong with my config? It feels that missing imports are likely an oversight during packaging.

@pkamenarsky
Copy link

Same here.

@coredumper
Copy link

coredumper commented Mar 29, 2024

I had the same issue but was able to resolve it manually. The problem was that lsprotocol pre-release version 2024.0.0a1 was installed. Removing that version and installing the current version 2023.0.1 made the problem go away:

$ cd ~/.local/share/nvim/mason/packages/jedi-language-server/venv
$ source bin/activate
$ pip uninstall lsprotocol
$ pip install lsprotocol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants