Unalbe to start subprocess for LSP-pylsp
thewchan opened this issue · comments
I'm seeing this message in ST4 console that's somewhat mysterious:
Unable to start subprocess for LSP-pylsp
Traceback (most recent call last):
File "C:\Users\mchan811\AppData\Roaming\Sublime Text\Installed Packages\LSP.sublime-package\plugin/core/windows.py", line 241, in start_async
plugin_class.install_or_update()
File "C:\Users\mchan811\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils\_client_handler\abstract_plugin.py", line 109, in install_or_update
server.install_or_update()
File "C:\Users\mchan811\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils\server_pip_resource.py", line 97, in install_or_update
self.run(self._python_binary, '-m', 'venv', self._package_name, cwd=self._storage_path)
File "C:\Users\mchan811\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils\server_pip_resource.py", line 35, in run
raise Exception(error)
Exception: Error: [WinError 2] The system cannot find the file specified
I tried reinstalling both LSP-pylsp and the LSP package to no avail. Any suggestions?
You need python installed. Its mentioned in the readme.
Then it appears that it's not in your PATH. Please read https://lsp.sublimetext.io/troubleshooting/#updating-the-path-used-by-lsp-servers
@rchl here some my project config that's relevant to pylsp:
"LSP-pylsp": {
"python_binary": "C:\\Users\\mchan811\\.conda\\envs\\streamlit\\python.exe",
"disabled_capabilities": {
"completionProvider": true,
"definitionProvider": true,
"documentHighlightProvider": true,
"documentSymbolProvider": true,
"hoverProvider": true,
"referencesProvider": true,
"renameProvider": true,
"signatureHelpProvider": true,
},
I'm using lsp-pyright as well and I don't have any problems
@rchl I'm pretty sure it's in my PATH, because it works with lsp-pyright. I'm just having trouble with pylsp
lsp-pyright doesn't use python binary - it's built in javascript.
That "python_binary" setting should in theory work, as long that path is correct.
Does it work to run that path on the command line?
env
shouldn't be relevant at this point. It's not used for that functionality.
It feels like your custom python_binary
is not used but not sure why. Would need to try to reproduce on Windows at some point.
And even if not relevant for this issue, the PATH is supposed to point at a directory, not a file.
I've realized now that python_binary
is not supported in project settings. Only in LSP-pylsp settings. There is no easy way of fixing that.