Python Language Server
raw JSON → 0.36.2 verified Fri May 01 auth: no python deprecated
An implementation of the Language Server Protocol (LSP) for Python. Version 0.36.2 is the final release; the project is deprecated in favor of python-lsp-server (a community fork) and pyright/pylance. It provides IDE features like autocompletion, linting, code navigation, and refactoring.
pip install python-language-server Common errors
error ModuleNotFoundError: No module named 'pyls' ↓
cause The package is installed but not in the current Python environment, or the wrong import name is used.
fix
Ensure the package is installed:
pip install python-language-server. Then import as import pyls. error AttributeError: module 'pyls' has no attribute 'ProcessServer' ↓
cause Using an older version of pyls that lacks the ProcessServer class (introduced in 0.36.0).
fix
Upgrade to the latest version:
pip install --upgrade python-language-server. error Error: No configuration found for 'pyls' ↓
cause Configuration file is missing or uses an outdated format.
fix
Create a
.pylsrc file in the project root or home directory. See https://github.com/palantir/python-language-server#configuration Warnings
deprecated python-language-server is deprecated. The Palantir project has been archived and no longer maintained. Users should migrate to python-lsp-server (community fork) or pyright/pylance. ↓
fix Replace python-language-server with python-lsp-server: `pip install python-lsp-server` and change imports to `import pylsp`.
breaking In version 0.36.0, the configuration format changed. Options that were previously under 'pyls' section are now under the tool's name (e.g., 'pyls.plugins' moved to 'pyls.plugins.jedi' etc.). ↓
fix Update your .pylsrc or editor settings to match the new schema. See: https://github.com/palantir/python-language-server/releases/tag/0.36.0
gotcha The package name on PyPI is python-language-server, but the import module is 'pyls'. Many users mistakenly try `import python_language_server` or `import pyls` with wrong casing. ↓
fix Use `import pyls` (all lowercase).
Imports
- pyls wrong
from pyls import servercorrectimport pyls
Quickstart
# Start the language server (usually launched by an editor plugin)
# For manual testing, run:
# pyls
# In code, you can invoke the server programmatically:
import pyls
server = pyls.ProcessServer()
print("Python Language Server started. Use an LSP client to connect.")