sublimelsp / LSP-ruff

LSP helper for ruff - an extremely fast Python linter, written in Rust.

Home Page:https://packagecontrol.io/packages/LSP-ruff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LSP-ruff not working in MacOS - No module named 'lsp_utils'

jlariza opened this issue · comments

Good day,

I installed LSP-ruff package in sublime. However, it did nothing. When I checked the sublime console, It shows this errors:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 308, in reload_plugin
    m = importlib.import_module(modulename)
  File "./python3.3/importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/Users/<user>/Library/Application Support/Sublime Text/Installed Packages/LSP-ruff.sublime-package/plugin.py", line 1, in <module>
ImportError: No module named 'lsp_utils'

...

plugins loaded
Package Control: The library "lsp_utils" is not available for Python 3.3

Seems that lsp_utils is not being loaded with the default python version used by sublime packages (3.3). How may I configure it to use the version it requires? What am I missing to make LSP-ruff work?

Thank you,

Caused by sublimelsp/repository#86.
Should resolve itself in 2, 3 hours.

@rchl it is now showing a different error:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 308, in reload_plugin
    m = importlib.import_module(modulename)
  File "./python3.3/importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 1692, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/Users/<user>/Library/Application Support/Sublime Text/Installed Packages/LSP-ruff.sublime-package/plugin.py", line 1, in <module>
  File "/Users/<user>/Library/Application Support/Sublime Text/Lib/python33/lsp_utils/__init__.py", line 6, in <module>
    from .generic_client_handler import GenericClientHandler
  File "/Users/<user>/Library/Application Support/Sublime Text/Lib/python33/lsp_utils/generic_client_handler.py", line 9, in <module>
    from package_control import events  # type: ignore
ImportError: cannot import name events

Try running Package Control: Satisfy dependencies from the Command Palette

@rchl did not work. The problem persists

Try removing LSP-ruff and re-installing again.
Also try to restart ST after of course.

@rchl no luck. Problem persists

Can you show the listing of your /Users/<user>/Library/Application Support/Sublime Text/Installed Packages directory?

@rchl These are the packages I have installed:

Babel.sublime-package                Sass.sublime-package
Djaneiro.sublime-package             SideBarEnhancements.sublime-package
LSP-ruff.sublime-package             Vue Syntax Highlight.sublime-package
LSP.sublime-package                  VueFormatter.sublime-package
Package Control.sublime-package

This issue pops up in various places for PC4 users. I'm not sure why but someone more familiar with PC4 would have to look into it. I've created an issue for it at wbond/package_control#1656 now.

Note that this issue is unrelated to the original one which was fixed.

If you still have this issue could you share the Package Control.sublime-package file and also zip the whole Lib directory and also provide it? It would help debugging the issue.