Now that you have VSCode installed and know how to open it, we need to discuss one final topic before you start creating your Python programs: VSCode Python extensions. You should see VSCode as a basic framework. It can do things like:
- Open, edit, and save files
- Lets you work on projects
- Start in-app terminals to keep things together
- Manage extensions
About Extensions
It’s the extensions where VSCode really starts to shine. It has extensions for virtually anything you can think of. Through these extensions, VSCode supports specific languages, like Python, but also Java, Kotlin, Javascript, Typescript, etcetera. But it also offers features like:
- Advanced code completion, where it suggests useful ways to continue with what you are typing, taking the context into consideration
- Integration with Version Control Systems like Git
- Integration with cloud-based services, like GitHub, Docker Hub, etc.
The power of VSCode is that it can do all of this at once. It’s not just a Python IDE, it’s also a great HTML editor, terrific at writing Javascript, and of course, it’s great with Python code too! And the best of all: you get to decide what you want it to be able to do. So you can keep it lean and mean, or install every plugin you ever need. It’s up to your taste!
How to install extensions
To install an extension in VSCode, you can press the large extensions button on the left, as shown in the following screenshot:

It will open the extensions marketplace. In there, enter Python in the search bar to find all extensions related to Python. You can click the extensions to read more about them and press the install button to install an extension. You can also open the extensions view with Ctrl+Shift+X (Cmd+Shift+X on a Mac).
The Best VSCode Python Extensions
Python
You at least want to install the official Python extension from Microsoft. It’s the base for everything else: it finds your Python installations and virtual environments, runs your code, and runs your tests. When you install it, VSCode also installs three companion extensions:
- Pylance gives you IntelliSense: code completion, type checking, go to definition, and refactoring.
- Python Debugger lets you set breakpoints and step through your code.
- Python Environments adds a panel where you can create, select, and manage virtual environments and the packages in them.
What the Python extension doesn’t do anymore is linting and formatting. Microsoft moved those into separate extensions, so you pick the tools you want. That brings us to the next one.
Ruff
Ruff is a linter and code formatter in one. It points out unused imports, undefined names, and many other problems while you type, and it can format your code on save. It replaces the older combination of flake8, isort, and Black, and it’s very fast. If you only add one extension to the Python extension, make it this one.
To format your files automatically, open the settings (Ctrl+, or Cmd+,), search for “format on save”, and tick the box. If VSCode asks which formatter to use for Python, choose Ruff.
Jupyter
The Jupyter extension lets you open and run Jupyter Notebooks (.ipynb files) right inside VSCode. If you do any data analysis or like to try out code in small steps, you’ll want it.
SonarQube for IDE
The SonarQube for IDE plugin detects common mistakes and bugs. It detects many security and code quality issues and has saved me more than once. I highly recommend it. It’s not just for Python but also supports common languages like Java, JavaScript, TypeScript, PHP, and more.
Python Indent
The Python Indent plugin helps you indent your code, especially when creating complex data structures between bracket pairs. E.g., when you create large nested lists, big dictionaries, etcetera.
autoDocstring
The autoDocstring extension helps you quickly generate docstring snippets.
GitHub Copilot (optional)
If you want AI code completion and a chat assistant in your editor, GitHub Copilot is built by GitHub and Microsoft and has a free tier. It’s optional, and if you’re just learning Python, I’d go easy on it: you learn more by writing the code yourself and only asking for help when you’re stuck.
Extensions you no longer need
Older tutorials, including an earlier version of this one, recommend a few extensions that you can skip today. If you have them installed, you can safely remove them.
MagicPython
MagicPython used to be a more up-to-date syntax highlighter for Python. It hasn’t been updated since 2018, and VSCode’s built-in Python highlighting has long since caught up with it.
Visual Studio IntelliCode
IntelliCode was Microsoft’s AI-assisted code completion extension. Microsoft has deprecated it for VSCode and points people to GitHub Copilot instead. Pylance already gives you good regular code completion.
Python Extension Pack
The Python Extension Pack installs a bundle of extensions in one go. I prefer to pick my own, and this pack shows why: it still includes IntelliCode and an environment manager extension that the official Python Environments extension has replaced. Packs like these can change their selection at any moment, too. Install the extensions above one by one instead, so you know what you have.