Bug 419834

Summary: Python LSP does not start on Windows 10
Product: [Applications] kate Reporter: Marcello Massaro <dev>
Component: applicationAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: christoph
Priority: NOR    
Version First Reported In: 19.12.2   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Marcello Massaro 2020-04-08 09:21:50 UTC
SUMMARY

When editing a Python file on Windows 10, the LSP cannot be started. The error message says that the command tha failed is

    python3 -m pyls --check-parent-process

If you install python from the main installer on python.org, the executable name is still `python`, not `python3`. I think that the `python3` executable get create only if you get Python from the Windows Store.

I have seen a mention in bug#419028 that another used was having problems with LSP and the Python server, although is not clear to me whether the problem is really the same or not.

STEPS TO REPRODUCE
1. Have pyls installed on your system (my case was `pip install python-language-server[all]`)
2. Open a python file with Kate.

OBSERVED RESULT
LSP does not start, failure message is (translated to english)

    Cannot start server: python3 -m pyls --check-parent-process

EXPECTED RESULT
LSP should work

SOFTWARE/OS VERSIONS
Windows: 10
Comment 1 Christoph Cullmann 2020-07-11 15:29:44 UTC
The master branch now uses

"pyls" "--check-parent-process"

to start the Python LSP server, that seems to work on Windows.

You can test it e.g. with the nightly installer that is linked on kate-editor.org

(or you added a local config that is like this below)

        "python": {
            "command": ["pyls", "--check-parent-process"],
            "url": "https://github.com/palantir/python-language-server",
            "highlightingModeRegex": "^Python$"
        },