Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Sublime text support #14

Open
guillaumerenault opened this issue Dec 18, 2018 · 1 comment
Open

Sublime text support #14

guillaumerenault opened this issue Dec 18, 2018 · 1 comment

Comments

@guillaumerenault
Copy link

guillaumerenault commented Dec 18, 2018

How can I install it in sublime text using the following LSP + pyls setup:

Thank you.

@oskaritimperi
Copy link

oskaritimperi commented Dec 30, 2019

These instructions are for Windows environment, but you should be able to use them without too much difficulty on other platforms.

Use pipx (https://pipxproject.github.io/pipx/) to install python-language-server:

pipx install python-language-server

Use pipx to install additional packages in the same virtualenv as python-language-server:

pipx inject python-language-server black pyls-black

Make sure the %USERPROFILE%\.local\bin is in PATH so that pyls command can be found by the LSP plugin.

Install the LSP Sublime plugin.

Open project settings (Project -> Edit Project). Make sure you have something like this in there to make pyls aware of your project specific virtual environment:

{
    "settings":
    {
        "LSP":
        {
            "pyls":
            {
                "enabled": true,
                "env": {
                    "VIRTUAL_ENV": "C:\\path\\to\\your\\project\\venv"
                }
            }
        }
    }
}

The key is to have python-language-server and pyls-black in the same virtual environment. I also have pyls-isort installed in the same environment so that imports are automatically sorted when formatting.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants