Skip to main content
Back to Extensions Directory
coc.nvim fallback icon

@yaegassy/coc-pylsp

yaegassy

pylsp (python-lsp-server) extension for coc.nvim

Installation CommandVim prompt
:CocInstall @yaegassy/coc-pylsp
GitHub owner
yaegassy
Version
v0.13.0
Requirements
coc ^0.0.80
License
MIT
Repository
GitHub
npm latest published 2025-12-08Registry checked 2026-08-23Registry summary

Published Package Summary

coc-pylsp

pylsp (python-lsp-server) extension for coc.nvim.

coc-pylsp-demo

Install

CocInstall:

:CocInstall @yaegassy/coc-pylsp

vim-plug:

Plug 'yaegassy/coc-pylsp', {'do': 'yarn install --frozen-lockfile'}

Detect: pylsp (python-lsp-server)

coc-pylsp detects and starts pylsp.

Priority to detect:

  1. pylsp.commandPath
  2. current python3/python environment (e.g. pylsp in venv)
  3. builtin pylsp (Installation commands are also provided)

Built-in install (pylsp and 3rd party plugins)

coc-pylsp allows you to create an extension-only "venv" and install "pylsp (python-lsp-server)" and "related tools" (e.g. pylsp-mypy).

By default, it is installed with pip install python-lsp-server[all]. (extras_require).

If you want to change "extras_require", please change the pylsp.builtin.installExtrasArgs setting

example:

  • Example1: "pylsp.builtin.installExtrasArgs": []
    • pip install python-lsp-server
  • Example2: "pylsp.builtin.installExtrasArgs": ["all"]:
    • pip install 'python-lsp-server[all]'
  • Example3: "pylsp.builtin.installExtrasArgs": ["yapf", "flake8"]:
    • pip install 'python-lsp-server[yapf,flake8]'

It also supports the installation of "3rd Party Plugins".

By default, the installation of 3rd Party Plugins is "disabled".

To "enable" it, change each setting in coc-settings.json.

{
  // snip...
  "pylsp.builtin.enableInstallPylspMypy": true,
  "pylsp.builtin.enableInstallPylsIsort": true,
  "pylsp.builtin.enableInstallPythonLspBlack": true,
  "pylsp.builtin.enableInstallPylspRope": true,
  "pylsp.builtin.enableInstallPythonLspRuff": true,
  // snip...
}

It is also possible to specify the version of the third party tool to be installed

{
  // snip...
  "pylsp.builtin.pylspMypyVersion": "0.5.2",
  "pylsp.builtin.pylsIsortVersion": "0.2.2",
  "pylsp.builtin.pythonLspBlackVersion": "1.0.1",
  "pylsp.builtin.pylspRopeVersion": "0.1.10",
  "pylsp.builtin.pythonLspRuffVersion": "1.0.5",
  // snip...
}

The first time you use coc-pylsp, if pylsp is not detected, you will be prompted to do a built-in installation.

You can also run the installation command manually.

:CocCommand pylsp.builtin.install

python-lsp-ruff

If you enable python-lsp-ruff then you will probably want to disable the built-in pycodestyle, pyflakes, mccabe and pyls_isort plugins, for example:

{
  "pylsp.plugins.pycodestyle.enabled": false,
  "pylsp.plugins.pyflakes.enabled": false
  "pylsp.plugins.mccabe.enabled": false,
  "pylsp.plugins.pyls_isort.enabled": false,
}

Although python-lsp-ruff tries to disable these automatically, they must be explicitly disabled when using coc-pylsp.

Use tcp mode

To use the tcp mode, set pylsp.connectionMode to 'tcp'. Also, pylsp needs to be started in tcp mode separately.

coc-settings.json:

{
  "pylsp.connectionMode": "tcp"
}

How to start pylsp in tcp mode:

# By default, host is 127.0.0.1 and port 2087 is set
pylsp --tcp
# Or specify any host (--host) and port (--port)
pylsp --tcp --host 127.0.0.1 --port 2087

Thanks

License

MIT


This extension is built with create-coc-extension

Read the complete README
  • pylsp (python-lsp-server) extension for coc.nvim
Activation Events
  • onLanguage:python
Developer Resources

Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.

Open Developer Guide

Version History

This published npm package does not include a history.md or changelog.md file. Browse its npm versions or repository releases for available release information.