You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I've installed LSP-pylsp and removed all previous installation of pylsp and flake8 from my system.
After activating LSP-pylsp, it has installed pylsp and dependencies in ~/.cache/sublime-text/Package Storage/LSP-pylsp, including flake8 in the /bin directory of the cache. Then I've activated flake8 in LSP-pylsp.sublime-settings.
It seems pylsp is unable to find flake8 from the cache as I got this error message in the log: LSP-pylsp: 2021-06-15 22:16:54,692 UTC - ERROR - pylsp.plugins.flake8_lint - Error while running flake8 '/bin/python: No module named flake8'
I've looked at the flake8_lint.py code and found that it's possible to specify the path to flake8 like this: pylsp.plugins.flake8.executable": "~/.cache/sublime-text/Package Storage/LSP-pylsp/bin/flake8"
However it's undocumented.
I've mentioned it in the LSP chan of the ST discord and @rwols proposed the following:
"what could also work is to add $storage_path/LSP-pylsp/bin to the $PATH programmatically (in LSP-pylsp) before we start the subprocess so that pylsp (the subprocess) will favor those bundled executables"
He also mentioned: "this sounds awfully similar to #64"
Could you check if LSP-pylsp could be modified so flake8 can be used directly from the cache /bin path as proposed above?
Thanks
The text was updated successfully, but these errors were encountered:
I guess the intended use of pylsp is that it's installed globally rather then per-project. So in that case using the global flake8 makes sense. I think we probably will have to override that path. Ideally internally rather than in the settings as that can be an implementation detail.
Hi,
I've installed LSP-pylsp and removed all previous installation of pylsp and flake8 from my system.
After activating LSP-pylsp, it has installed pylsp and dependencies in ~/.cache/sublime-text/Package Storage/LSP-pylsp, including flake8 in the /bin directory of the cache. Then I've activated flake8 in LSP-pylsp.sublime-settings.
It seems pylsp is unable to find flake8 from the cache as I got this error message in the log:
LSP-pylsp: 2021-06-15 22:16:54,692 UTC - ERROR - pylsp.plugins.flake8_lint - Error while running flake8 '/bin/python: No module named flake8'
I've looked at the flake8_lint.py code and found that it's possible to specify the path to flake8 like this:
pylsp.plugins.flake8.executable": "~/.cache/sublime-text/Package Storage/LSP-pylsp/bin/flake8"
However it's undocumented.
I've mentioned it in the LSP chan of the ST discord and @rwols proposed the following:
"what could also work is to add $storage_path/LSP-pylsp/bin to the $PATH programmatically (in LSP-pylsp) before we start the subprocess so that pylsp (the subprocess) will favor those bundled executables"
He also mentioned: "this sounds awfully similar to #64"
Could you check if LSP-pylsp could be modified so flake8 can be used directly from the cache /bin path as proposed above?
Thanks
The text was updated successfully, but these errors were encountered: