Sublime Forum

Error in plugin loading order

#1

Plugins in User/ must be loaded last. But now in ST4 i’ve got an error:
reloading plugin User.phpstanlinter
Traceback (most recent call last):
File “C:\Program Files\Sublime Text 3\Lib\python38\sublime_plugin.py”, line 312, in reload_plugin
m = importlib.import_module(modulename)
File “./python3.8/importlib/init.py”, line 127, in import_module
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 808, in exec_module
File “”, line 219, in _call_with_frames_removed
File “C:\Users\vampirus\AppData\Roaming\Sublime Text 3\Packages\User\phpstanlinter.py”, line 1, in
from SublimeLinter.lint import Linter # or NodeLinter, PythonLinter, ComposerLinter, RubyLinter
ModuleNotFoundError: No module named ‘SublimeLinter’

and after then
reloading python 3.3 plugin SublimeLinter-contrib-phpstan.linter
reloading python 3.3 plugin SublimeLinter-php.linter
reloading python 3.3 plugin SublimeLinter.init
reloading python 3.3 plugin SublimeLinter._init
reloading python 3.3 plugin SublimeLinter.active_linters_view

0 Likes

#2

This is because the User package is now running in the Python 3.8 runtime. SublimeLinter runs in py33.

0 Likes

#3

What you could do is create a folder in Packages/ that is lexicographically larger than “SublimeLinter” and move your plugin in there. That should make it work with SL.

1 Like