sublimelsp / LSP-pylsp

Convenience package for the Python Language Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to start subprocess for LSP-pylsp - Python binary not found

Archer6621 opened this issue · comments

Hey, I'm trying to run LSP-pylsp in ST4 (Build 4169) on Windows 11, but I'm unable to get it to start. Regardless of where I point the python_binary variable to in the global config (not the project-specific one), or even leaving it empty, it always greets me with the same dialog:

image

I have Python 3.12.2 installed and it works fine with everything else, including pyright.

In the console I get:

Traceback (most recent call last):
  File "C:\Users\shaad\AppData\Roaming\Sublime Text\Installed Packages\LSP.sublime-package\plugin/core/windows.py", line 250, in start_async
    if plugin_class.needs_update_or_installation():
  File "C:\Users\shaad\AppData\Roaming\Sublime Text\Lib\python33\lsp_utils\_client_handler\abstract_plugin.py", line 101, in needs_update_or_installation
    server = cls.get_server()
  File "C:\Users\shaad\AppData\Roaming\Sublime Text\Lib\python33\lsp_utils\pip_client_handler.py", line 67, in get_server
    raise Exception('Python binary "{}" not found!'.format(python_binary))
Exception: Python binary "C:\Users\shaad\styxvenv312\bin\python" not found!

As you can see it does pick up on the binary_path setting, it just doesn't see it as a binary for some reason.

I first thought it was the same problem as #125 , but the error seems to be different.

Binaries on Windows have extensions and from the error it's clear that you haven't provided the extension. You need to make sure that the binary path that you've specified exists.

Binaries on Windows have extensions and from the error it's clear that you haven't provided the extension. You need to make sure that the binary path that you've specified exists.

Thank you for the reply. Seems that making it point to a venv (which is extension-less by nature, also on Windows) is what caused the problem, when I set the path to an actual Python executable from an installation it started working :)