🌐
LSP Mode
emacs-lsp.github.io › lsp-mode › page › lsp-pylsp
Python (Pylsp) - LSP Mode - LSP support for Emacs
Type: (alist :key-type (lsp-string-vector :tag rules) :value-type (string :tag severity)) ... Optional table of rules where a custom severity is desired. ... The minimum python version to target (applies for both linting and formatting).
🌐
Reddit
reddit.com › r/emacs › new(ish) python lsp server which works with emacs: basedpyright
r/emacs on Reddit: New(ish) Python LSP server which works with Emacs: basedpyright
January 24, 2025 -

A new to me LSP server for Python has appeared: basedpyright. This is a fork of the fast pyright langserver which Microsoft develops, with a more OSS philosophy. It has lots of improvements bringing it close to (and in some cases surpassing) the proprietary, MS VSCode-only LSP server pylance which wraps pyright:

Basedpyright is a fork of pyright with various type checking improvements, improved vscode support and pylance features built into the language server.

You can read about all the improvements over pyright. The one most meaningful to me is "docstrings for compiled builtin modules". E.g. docs with eglot go from:

pyright:

class range(
    stop: SupportsIndex,
    /
)

to

basedpyright:

class range(
    stop: SupportsIndex,
    /
)

range(stop) -> range object
range(start, stop[, step]) -> range object

Return an object that produces a sequence of integers from start (inclusive)
to stop (exclusive) by step.  range(i, j) produces i, i+1, i+2, ..., j-1.
start defaults to 0, and stop is omitted!  range(4) produces 0, 1, 2, 3.
These are exactly the valid indices for a list of 4 elements.
When step is given, it specifies the increment (or decrement).

Recent eglot versions already support it: just pip install basedpyright. Works fine with lsp-booster and all the normal settings.

Discussions

Python. So many lsp-server options. Which one is "the right one"
I use basedpyright with no issues. More on reddit.com
🌐 r/emacs
19
13
April 3, 2025
Frustrating python lsp experience
For how long this post is, it doesn't contain a lot of specifics. Have you tried profiling the alleged memory leak in lisp-mode or is it just your hunch? Have you communicated any of these issues to the package maintainers? More on reddit.com
🌐 r/emacs
35
32
November 14, 2023
🌐
Slinkp
slinkp.com › python-emacs-lsp-20231229.html
Modernizing my Python development setup in Emacs
December 29, 2023 - This means running a command such as pip install python-lsp-server or pip install pyright. But... what about when you frequently work on multiple projects, each with their own environment? You don't want them to clash with each other, or you might run into trouble such as your language server ...
🌐
GitHub
github.com › emacs-lsp › lsp-python-ms
GitHub - emacs-lsp/lsp-python-ms: lsp-mode Microsoft's python language server · GitHub
July 31, 2023 - lsp-mode :heart: Microsoft's python language server - emacs-lsp/lsp-python-ms
Starred by 187 users
Forked by 41 users
Languages   Emacs Lisp 98.7% | Makefile 1.3%
🌐
Andrewfavia
andrewfavia.dev › posts › emacs-as-python-ide-again
Andrew Favia | LSP's & Eglot
In this post I will share part of my set up when working in Python or Go using their LSP's and the Eglot client now already built in Emacs. The objective of this post is to provide a few pointers on how to set up your Emacs config and Eglot so that you can already get started with the starting features needed to develop in Go or Python.
🌐
Mattduck
mattduck.com › lsp-python-getting-started.html
Getting started with lsp-mode for Python
April 26, 2020 - The most popular LSP client for ... popups and "sideline" information). For Python support, there are two main language servers - pyls and Microsoft Python Language Server....
🌐
GitHub
github.com › emacs-lsp › lsp-mode
GitHub - emacs-lsp/lsp-mode: Emacs client/library for the Language Server Protocol · GitHub
Real-time Diagnostics/linting via flycheck (recommended) or flymake when Emacs > 26 (requires flymake>=1.0.5) Code completion - company-capf / completion-at-point (note that company-lsp is no longer supported). ... Code actions - via lsp-execute-code-action, modeline (recommended) or lsp-ui sideline. ... Code navigation - using builtin xref, lsp-treemacs tree views or lsp-ui peek functions. ... Semantic tokens as defined by LSP 3.17 (compatible language servers include recent development builds of clangd and rust-analyzer)
Starred by 5.1K users
Forked by 971 users
Languages   Emacs Lisp 99.2% | TeX 0.2% | HTML 0.2% | PowerShell 0.2% | Makefile 0.1% | YASnippet 0.1%
Find elsewhere
🌐
System Crafters
systemcrafters.net › emacs-ide › python-development-config
Python Development Configuration - System Crafters
https://emacs-lsp.github.io/lsp-mode/page/languages/ pip install --user python-language-server[all] Ensure that it’s on the PATH! If not, you may need to add ~/.local/bin to PATH · We are starting with the lsp-mode configuration from “Build Your Own IDE with lsp-mode”, check that out for more details on lsp-mode!
🌐
Chris's Wiki
utcc.utoronto.ca › ~cks › space › blog › python › PythonEmacsLSPWorthIt
Chris's Wiki :: blog/python/PythonEmacsLSPWorthIt
More broadly, I think that the Python LSP server and LSP mode is the most likely future of smart Python editing in GNU Emacs, so I might as well get on board now.
🌐
Gregnewman
gregnewman.io › blog › trying-ty-for-lsp-in-emacs
Trying Ty for my LSP in Emacs | Greg Newman
December 16, 2025 - ;; Python LSP Server Selection (defvar my/python-lsp-server 'ty "Which Python language server to use: 'basedpyright or 'ty") (defun my/python-lsp-command () "Return the LSP command based on selected server." (pcase my/python-lsp-server ('ty '("ty" "server")) ('basedpyright '("basedpyright-langserver" "--stdio" :initializationOptions (:basedpyright (:plugins ( :ruff (:enabled t :lineLength 88 :exclude ["E501"] :select ["E" "F" "I" "UP"]) :pycodestyle (:enabled nil) :pyflakes (:enabled nil) :pylint (:enabled nil) :rope_completion (:enabled t) :autopep8 (:enabled nil)))))))) (defun my/switch-python-lsp () "Toggle between Ty and basedpyright, restart Eglot."
🌐
Hacker News
news.ycombinator.com › item
This is a very important release for LSP users, as Emacs now has a fast, C-based... | Hacker News
August 24, 2020 - 1. Languages where people put a lot of effort into implementing bespoke support inside Emacs itself (as Elisp packages) · 2. Languages where no one bothered to make Emacs-specific features, but are now supported quite well via LSP
🌐
EmacsConf
emacsconf.org › 2022 › talks › lspbridge
EmacsConf - 2022 - talks - lsp-bridge: a smooth-as-butter asynchronous LSP client
December 21, 2022 - It offloads all the computation to an external python process, and hence the emacs session itself stays always responsive, as it has very few things to do. lsp-bridge has now supported 39 LSP servers and all kinds completion backend: include LSP、 TabNine、 Citre、 Elisp、 Search Words、 Path、 Yasnippet、 Tempel、 Telegra、 English etc, it just works pretty well out of the box.
🌐
Medium
medium.com › code-is-data-data-is-code › supercharge-your-python-development-with-emacs-lsp-mode-c4b15352a273
Supercharge Your Python Development with Emacs LSP-Mode | by Gwang-Jin | Code is Data, Data is Code | Medium
June 21, 2024 - Today, I want to introduce you ... Language Server Protocol (LSP) bridges the gap between editors and language servers, providing features like code completion, navigation, and refactoring....
🌐
vxlabs
vxlabs.com › 2018 › 11 › 19 › configuring-emacs-lsp-mode-and-microsofts-visual-studio-code-python-language-server
Configuring Emacs, lsp-mode and Microsoft's Visual Studio Code Python language server. - vxlabs
November 19, 2018 - mkdir ~/build cd ~/build git clone ... install the required and some optional packages using for example M-x package-install: lsp-mode – the main language server protocol package...
🌐
Reddit
reddit.com › r/emacs › python. so many lsp-server options. which one is "the right one"
r/emacs on Reddit: Python. So many lsp-server options. Which one is "the right one"
April 3, 2025 -

After years of enjoying freedom from writing Python code, I now find myself reluctantly returning to this once familiar territory, and almost instantly got overwhelmed with decision fatigue.

At the moment, I can't figure out which lsp-server to use. There's:

  • pylsp,

  • jedi,

  • palantir-made (deprecated),

  • microsoft made (deprecated),

  • microsoft made pyright,

  • stripped down version of it - pyright-based,

  • rust made ruff,

  • PyDev (does it even work with Emacs?),

  • C#-made, archived and unmaintained python-language-server

It'd be fine if there was just some overlapping functionality, but it seems they all have some features that just don't work. Like for example python-lsp-server can't let you browse workspace symbols. Which for me, honestly, really is a deal breaker. I use consult-lsp-symbols command all the time.

And then after choosing an lsp-server, I have to tune up some checking, linting features, and I'm not sure which one of these are "relevant": black or yapf or ruff, flake8, rope, mypy, pydocstyle, pylint, jedi; OMG, why are there so many linters?

What do you folks use? I thought configuring Emacs for web dev these days was a hassle - I had no idea how messy the Python world has become.

🌐
GitHub
github.com › emacs-lsp › lsp-pyright
GitHub - emacs-lsp/lsp-pyright: lsp-mode pyright · GitHub
(use-package lsp-pyright :ensure t :custom (lsp-pyright-langserver-command "pyright") ;; or basedpyright :hook (python-mode .
Starred by 324 users
Forked by 27 users
Languages   Emacs Lisp 97.2% | Makefile 2.8%
🌐
GitHub
github.com › manateelazycat › lsp-bridge
GitHub - manateelazycat/lsp-bridge: A blazingly fast LSP client for Emacs · GitHub
We welcome patches to help us support more LSP servers. Thank you for your help! ... Main Elisp entry, including user options, mode integration, and RPC entry points to the Python backend ... Please use emacs -q and load a minimal setup with only lsp-bridge to verify that the bug is reproducible.
Starred by 1.7K users
Forked by 239 users
Languages   Emacs Lisp 58.2% | Python 41.8%
🌐
Ian Y.E. Pan
ianyepan.github.io › posts › emacs-ide
Building an Intelligent Emacs | Ian Y.E. Pan
September 2, 2022 - Clangd is my choice of language server for both C and C++. If for some reason you don’t like LLVM’s implementation, you can try out ccls, an alternative language server for C/C++/ObjC. For lsp-mode to prioritize ccls over clangd, you need to install and set up this extra client that leverages lsp-mode. Emacs detecting typos and suggesting fixes, powered by LSP. LSP-mode supports 5 different Python language servers, namely Spyder IDE’s python-lsp-server, the Jedi language server, Palantir’s pyls, Microsoft’s Pyright language server, and Microsoft’s Python language server.
🌐
Taingram
taingram.org › blog › emacs-lsp-ide.html
Building Your Own Emacs IDE with LSP
June 17, 2021 - First we need to add MELPA, a community maintained Emacs package repository, by adding the following to your init file: (require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) (package-initialize) ... (require 'lsp-mode) ;; Start lsp when you open a file for each langauge (add-hook 'python-mode-hook #'lsp) (add-hook 'go-mode-hook #'lsp) ;; Add more languages as needed
🌐
Reddit
reddit.com › r/emacs › frustrating python lsp experience
r/emacs on Reddit: Frustrating python lsp experience
November 14, 2023 -

I'm losing my mind over emacs as a python IDE. It seems that no matter which LSP concept I attempt, the experience is suboptimal. At best it is riddled with odd issues, and at worst almost bordering unusable.

I work as a python developer, and I work on quite large code bases. The LSP experience is essential for me given the complexity, but I'm at the point of giving up, even though I've been an emacs user for the better part of a decade.

I use doom emacs, by the way, but I'm quite happy to try anything to solve this. I have considered to build an emacs config from scratch again to see if I can narrow down the experience, but right now I have not invested the time. But again, considering how frustrated and desparate I am, everything is on the table.

Let me describe what I need and what I've tried.

My requirements

I need my lsp to understand my environment in order to load in a custom PYTHONPATH variable. This I handle with a .envrc file and the emacs module envrc. This has worked without any problems so far.

For the actual LSP, I use python-lsp-server but I am not at all religious about it.

I run mypy on my codebase, and I'd like to use ruff for checking/formating, but I've used the other tools (pycodestyle/black) for now.

lsp-mode

The lsp-mode is the one that is closest to being good, had it not been for the abysmal behavior over time. It seems that some memory leaking happens, and over time it becomes sluggish, sometimes blocking emacs for multiple seconds.

eglot

Eglot seems a lot faster, but has functional problems. I've often had to restart eglot when opening new python modules. I've tried to use eglot for months now, accepting the quirks to gain the speed, but the restart behavior is annoying, and I often get weird errors such as error in process filter: Wrong type argument: plistp, [] repeatedly until I restart eglot again. No luck debugging that error so far either.

I'm also not super excited about the .dir-locals.el approach to customization, but should the other issues resolve, I'm willing to figure that one out.

lsp-bridge

I was quite excited to hear about a third option that was super fast. However, I've not manage to get it to work with the envrc package, so I've parked that one.

So, I turn to you, kind strangers on the internet. Do you have a well-functioning python LSP setup in emacs? Have you experienced some of the issues that I have described and did you manage to solve it?

Do you perhaps have a described approach to building a great python setup with emacs? Please help me!