Download and install VS Code
VS Code is available for Windows, macOS, and Linux. Visit code.visualstudio.com — the site detects your operating system automatically and shows the correct download button.1
Download the installer
Go to code.visualstudio.com and click the download button for your platform.
2
Run the installer for your OS
- Windows
- macOS
- Linux
- Run the downloaded
.exeinstaller - Accept the licence agreement
- On the Select Additional Tasks screen, check all of the following:
- ✅ Add “Open with Code” to Windows Explorer file context menu
- ✅ Add “Open with Code” to Windows Explorer directory context menu
- ✅ Register Code as an editor for supported file types
- ✅ Add to PATH
- Click Next, then Install, then Finish
The “Add to PATH” option lets you open VS Code from any terminal by typing
code . — don’t skip it.3
Verify the installation
Open VS Code. You should see the Welcome tab with a clean, modern interface. If it opens without errors, you are good to proceed.
Install the Python extension
The Python extension by Microsoft is essential — it adds syntax highlighting, IntelliSense code completion, linting, debugging, and interpreter management.1
Open the Extensions panel
Click the Extensions icon in the left sidebar (four squares), or press
Ctrl + Shift + X (Windows/Linux) / Cmd + Shift + X (macOS).2
Search for and install Python
Search for Python, find the one published by Microsoft (millions of downloads), and click Install.
Without the Python extension, VS Code treats
.py files as plain text. This extension is what enables everything Python-specific in the editor.Install Pylance and Jupyter
While you have the Extensions panel open, install these two additional Microsoft extensions:- Pylance — provides significantly better type checking, code completion, and import resolution than the base Python extension alone
- Jupyter — enables interactive Python execution and
.ipynbnotebook support, which you will use throughout this course
Enable “Execute in File Directory”
This one setting prevents a very common source of errors for beginners.1
Open Settings
Press
Ctrl + , (Windows/Linux) or Cmd + , (macOS).2
Find the setting
Search for Python Terminal Execute In File Dir.
3
Enable it
Check the box to turn it on.
open('data.csv') in your script will look for data.csv in the same folder as your script — which is almost always what you intend.
Verify Python is detected
After installing the Python extension:- Press
Ctrl + Shift + P(Windows/Linux) orCmd + Shift + P(macOS) to open the Command Palette - Type Python: Select Interpreter
- You should see your installed Python version listed
Optional: Customise the appearance
These appearance tweaks are optional but worth considering if you plan to spend a lot of time in the editor.Create a workspace
Learn how to organise your Python projects in VS Code.