How to switch vscode to use pylance rather than jedi?

13.4k Views Asked by At

I am trying to use match/case from python 3.10, but jedi doesn't support the syntax. I've heard pylance is better, but I can't find any way to switch vscode to pylance. I've downloaded the default Python extension, but only the jedi language server is running. How can I make the switch?

EDIT: Adding a picture of trying to search for "pylance" so there's no confusion, it's not there at all. It seems to claim it's part of the python extension, but the language server being used is always jedi.
enter image description here

Python extension packs: enter image description here

4

There are 4 best solutions below

3
Marcus Hagberg On BEST ANSWER

I was using the open source version of vscode which doesn't have all extensions. Switching to the proprietary version (available on the AUR) fixed my issue.

15
rioV8 On

Change the setting: python.languageServer

1
liambaumann On

Go to Settings > Extensions > Python, head down to Language Server and change Default to Pylance. This fix also works in the Open Source version, VS Codium. It should have nothing to do with the version of VScode you're using.

0
roipoussiere On

Pylance is not compatible with VSCodium. Even if you install it with the official Marketplace, Pylance will display this message:

You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. [...]

You can eventually set python.languageServer setting to None, and use Pyright for type checking.