DEV Community

Cover image for How to Install Python in VS Code on Windows, Mac & Linux (Easy Guide)
Vladislav Guzey
Vladislav Guzey

Posted on

How to Install Python in VS Code on Windows, Mac & Linux (Easy Guide)

In this simple tutorial, I’m going to show you how you can install Python inside VS Code for Linux, Windows, and Mac. It’s pretty simple and straightforward.

Open Terminal in VS Code

First, open the terminal in VS Code using the following commands:
Windows or Linux: Ctrl + '
macOS: ⌘ + '

Windows

You have a few reliable methods:

  1. Using Windows Package Manager (winget)
winget install -e --id Python.Python.3.11 --scope machine
Enter fullscreen mode Exit fullscreen mode

This installs Python 3.11 system‑wide and adds it to your PATH.

  1. Using Chocolatey (if installed):
choco install python
Enter fullscreen mode Exit fullscreen mode

This installs the latest Python via Chocolatey and configures your PATH for you.

macOS

Using Homebrew (must have Homebrew installed):

brew install python
Enter fullscreen mode Exit fullscreen mode

This will install Python 3 and make it available as python3 in your terminal.

Linux

Commands can vary by distribution:

Debian/Ubuntu-based systems:

sudo apt update
sudo apt install python3
Enter fullscreen mode Exit fullscreen mode

Optionally, you can install a package like python-is-python3 to let python run Python 3 instead.

Other distros (e.g., Fedora):

sudo dnf install python3
Enter fullscreen mode Exit fullscreen mode

Or use whichever package manager your distro uses to install the python3 package.

Video Tutorial

Watch on YouTube: How to Install Python in VS Code

Top comments (0)