-
-
Notifications
You must be signed in to change notification settings - Fork 308
Error when importing pylsp #1902
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
Comments
Same on Debian 12 with NVIM v0.10.4 and Mason 1.11.0 and mason-lspconfig 1.32.0 Strangely, when I open a python shell in some terminal, I can do I've just formatted the error message here: Traceback (most recent call last):
File "$HOME/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.11/site-packages/pylsp_jsonrpc/endpoint.py", line 117, in consume
self._handle_request(message['id'], message['method'], message.get('params'))
File "$HOME/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.11/site-packages/pylsp_jsonrpc/endpoint.py", line 197, in _handle_request
handler_result = handler(params)
^^^^^^^^^^^^^^^
File "$HOME/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.11/site-packages/pylsp_jsonrpc/dispatchers.py", line 25, in handler
return method(**(params or {}))
^^^^^^^^^^^^^^^^^^^^^^^^
File "$HOME/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.11/site-packages/pylsp/python_lsp.py", line 326, in m_initialize
self.config = config.Config(
^^^^^^^^^^^^^^
File "$HOME/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.11/site-packages/pylsp/config/config.py", line 89, in __init__
self._pm.load_setuptools_entrypoints(PYLSP)
File "$HOME/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.11/site-packages/pluggy/_manager.py", line 421, in load_setuptools_entrypoints
plugin = ep.load()
^^^^^^^^^
File "$HOME/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.11/site-packages/importlib_metadata/__init__.py", line 189, in load
module = import_module(match.group('module'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1142, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pylsp.plugins.rope_rename' This python error message was inside the Error executing vim.schedule lua callback:
...nvimL3OaY1/usr/share/nvim/runtime/lua/vim/lsp/client.lua:588: RPC[Error] code_name = InvalidParams, message = "ModuleNotFoundError: No module named 'pylsp.plugins.rope_rename'" data = { PYTHON ERROR }
stack traceback:
[C]: in function 'assert'
...nvimL3OaY1/usr/share/nvim/runtime/lua/vim/lsp/client.lua:588: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0> |
I've searched open issues for similar requests
I've manually reviewed logs to find potential errors
I've recently downloaded the latest plugin version of mason.nvim
Problem description
As soon as a python file is open with nvim, with pylsp active for python and I have the following error.
Long story short, the file
$HOME/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.11/site-packages/pylsp/plugins/rope_rename.py
is missing.Another example of the problem in stackoverflow
A quick fix, is to create it (and the error is gone).
I do not really know lsp, mason or how any of this works hence I do not know if the issue is mason one, pylsp or other...
The only thing I did find out and may help to solve the issue is that the new repository python-lsp-server, does not have the
rope_name.py
file.Nevertheless, there is an old palantir repository which do contains the file.
Mason registry and nvim-lspconfig both have the new referenced.
Expected behavior
Not to have the error mentioned above.
Steps to reproduce
Open a python file with neovim.
Affected packages
pylsp
Neovim version (>= 0.7)
Neovim 0.10.2
Mason up to date through LazyVim.
Operating system/version
Linux 6.1.0-32-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.129-1 (2025-03-06) x86_64 GNU/Linux
Healthcheck
Screenshots or recordings
No response
The text was updated successfully, but these errors were encountered: