sublimelsp / LSP-ruff

LSP helper for ruff - an extremely fast Python linter, written in Rust.
https://packagecontrol.io/packages/LSP-ruff
MIT License
38 stars 4 forks source link

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

Closed jlariza closed 1 year ago

jlariza commented 1 year ago

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,

rchl commented 1 year ago

Caused by https://github.com/sublimelsp/repository/pull/86. Should resolve itself in 2, 3 hours.

jlariza commented 1 year ago

@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
rchl commented 1 year ago

Try running Package Control: Satisfy dependencies from the Command Palette

jlariza commented 1 year ago

@rchl did not work. The problem persists

rchl commented 1 year ago

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

jlariza commented 1 year ago

@rchl no luck. Problem persists

rchl commented 1 year ago

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

jlariza commented 1 year ago

@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
rchl commented 1 year ago

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 https://github.com/wbond/package_control/issues/1656 now.

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

rchl commented 1 year ago

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.