Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unalbe to start subprocess for LSP-pylsp #125

Open
thewchan opened this issue Jun 8, 2023 · 13 comments
Open

Unalbe to start subprocess for LSP-pylsp #125

thewchan opened this issue Jun 8, 2023 · 13 comments
Labels
enhancement New feature or request

Comments

@thewchan
Copy link

thewchan commented Jun 8, 2023

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?

@rchl
Copy link
Member

rchl commented Jun 8, 2023

You need python installed. Its mentioned in the readme.

@rchl rchl closed this as completed Jun 8, 2023
@rchl rchl added the question Further information is requested label Jun 8, 2023
@thewchan
Copy link
Author

thewchan commented Jun 8, 2023

@rchl I have python installed?

@rchl
Copy link
Member

rchl commented Jun 8, 2023

Then it appears that it's not in your PATH. Please read https://lsp.sublimetext.io/troubleshooting/#updating-the-path-used-by-lsp-servers

@thewchan
Copy link
Author

thewchan commented Jun 8, 2023

@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,
				},

@thewchan
Copy link
Author

thewchan commented Jun 8, 2023

I'm using lsp-pyright as well and I don't have any problems

@thewchan
Copy link
Author

thewchan commented Jun 8, 2023

@rchl I'm pretty sure it's in my PATH, because it works with lsp-pyright. I'm just having trouble with pylsp

@rchl
Copy link
Member

rchl commented Jun 8, 2023

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?

@thewchan
Copy link
Author

thewchan commented Jun 8, 2023

Got it re: pyright, that make sense.

Here's on the CLI/terminal:

image

@thewchan
Copy link
Author

thewchan commented Jun 8, 2023

@rchl I'm trying to do both env and python_binary now but still no go

image

@thewchan
Copy link
Author

thewchan commented Jun 8, 2023

@rchl maybe it's something to do with virtual envs? I'm using conda envs

@rchl
Copy link
Member

rchl commented Jun 8, 2023

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.

@rchl rchl reopened this Jun 8, 2023
@thewchan
Copy link
Author

thewchan commented Jun 8, 2023

@rchl should I try to point PATH in the config to a directory?

@rchl
Copy link
Member

rchl commented Nov 15, 2023

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.

@rchl rchl added enhancement New feature or request and removed question Further information is requested labels Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants