Reputation:
I just shifted from my old bud Sublime to VSCode. I really liked the way it works and the features it has. I'm a newbie python developer. I found two popular python extensions for VSCode: Python, and PyLance. My question is, What is the difference between Python and Pylance extension? I searched a lot but didn't find a good comparison.
Upvotes: 30
Views: 30496
Reputation: 10374
As an editor, VSCode cannot recognize all languages and many functions cannot be implemented independently. Therefore, when we use Python code in VSCode, we need to install the 'Python' extension, which provides us with functions such as code completion, support for Jupyter notebooks, debugging Python code, etc. Therefore, the Python extension is one of the necessary dependencies for using Python in VSCode.
The extension 'Pylance' needs to be used in conjunction with the Python
extension. It cannot be used independently in VSCode. It mainly provides outstanding Python language services (other Python language services such as "Microsoft
", "Jedi
", don't need to install specific extensions, they can be used as-is after installation). At the same time, it also provides functions such as docstrings. Therefore, the Pylance extension is not a necessary condition, but a recommended extension.
It is recommended that you install and use these two extensions. They are not opposite extensions, they are VSCode extensions that cooperate with each other (To be precise, the 'Pylance' extension relies on the 'Python' extension to use).
And for more related information, you could refer to the VS Code docs on: Using Python in VSCode and Python and Pylance.
Upvotes: 40