VSCode
Summary. Visual Studio Code (VSCode) is the lab’s default code editor. It is free, cross-platform, and — with a few extensions — handles our Python work, Jupyter notebooks, Git, remote lab machines, and Docker from a single window. This guide covers installing it, the extensions we recommend, and a baseline configuration.
Prerequisites
- A laptop or lab workstation running Windows 10/11, macOS, or Linux.
- Administrator rights to install software (or ask a lab member).
- For Python work, a Python environment — see Python Environments.
Install
Windows
- Download the User Installer from https://code.visualstudio.com/.
- Run the installer. On the Select Additional Tasks screen, tick “Add to PATH” and “Register Code as an editor for supported file types”.
- Launch VSCode from the Start menu.
macOS
- Download the macOS build from https://code.visualstudio.com/ (choose Apple Silicon or Intel to match your Mac).
- Unzip and drag Visual Studio Code.app into Applications.
- Open VSCode, then press Cmd+Shift+P and run “Shell Command: Install ‘code’ command in PATH” so you can launch it from the terminal with
code ..
Linux (Debian/Ubuntu)
sudo apt-get update
sudo apt-get install -y wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null
rm -f packages.microsoft.gpg
sudo apt-get update
sudo apt-get install -y code
On other distributions you can install the Snap (
sudo snap install code --classic) or the.rpm/.debpackage from the download page.
Verify the install from a terminal:
code --version
Recommended Extensions
Open the Extensions view with Ctrl/Cmd+Shift+X and search by name, or install from the terminal with code --install-extension <id>.
| Extension | ID | What it does |
|---|---|---|
| Python | ms-python.python | Core Python support: run, debug, select interpreter |
| Pylance | ms-python.vscode-pylance | Fast IntelliSense and type checking |
| Jupyter | ms-toolsai.jupyter | Run and edit .ipynb notebooks inside VSCode |
| Ruff | charliermarsh.ruff | Fast Python linter/formatter |
| Black Formatter | ms-python.black-formatter | Opinionated Python code formatter |
| GitLens | eamodio.gitlens | Rich Git history, blame, and comparisons |
| Remote - SSH | ms-vscode-remote.remote-ssh | Edit code on a lab server/robot over SSH |
| Docker | ms-azuretools.vscode-docker | Build and manage Docker images/containers |
Lab note: (list any extensions that are required/standard for our projects here — to be added.)
Install the core set in one command:
code --install-extension ms-python.python \
--install-extension ms-python.vscode-pylance \
--install-extension ms-toolsai.jupyter \
--install-extension charliermarsh.ruff \
--install-extension eamodio.gitlens
Configuration
Select the Python interpreter
Open a project folder (Ctrl/Cmd+K Ctrl/Cmd+O), then press Ctrl/Cmd+Shift+P and run “Python: Select Interpreter”. Pick the environment you created in the Python Environments guide (e.g. your .venv or a conda env).
Baseline settings
Open the Command Palette → “Preferences: Open User Settings (JSON)” and add:
{
"editor.formatOnSave": true,
"editor.rulers": [88],
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
}
}
Project-specific settings go in a .vscode/settings.json file committed with the repo, so everyone on the project shares the same setup.
Integrated terminal
Open it with Ctrl+` (backtick). It inherits your selected Python environment, so python, pip, and jupyter point at the right place.
Working on a Lab Machine (Remote - SSH)
To edit and run code directly on a lab server or a robot’s host computer:
- Install the Remote - SSH extension.
- Press Ctrl/Cmd+Shift+P → “Remote-SSH: Connect to Host…”.
- Enter
user@hostname(or pick a host from your~/.ssh/config). - Once connected, open the remote folder — extensions like Python run on the remote machine, not your laptop.
Lab note: (add the lab’s server/robot hostnames and SSH access instructions here — to be added.)
Useful Shortcuts
| Action | Windows/Linux | macOS |
|---|---|---|
| Command Palette | Ctrl+Shift+P | Cmd+Shift+P |
| Quick open file | Ctrl+P | Cmd+P |
| Toggle terminal | Ctrl+` | Cmd+` | |
| Format document | Shift+Alt+F | Shift+Option+F |
| Comment line | Ctrl+/ | Cmd+/ |
| Go to symbol | Ctrl+Shift+O | Cmd+Shift+O |
Tips & Troubleshooting
codecommand not found (macOS): run “Shell Command: Install ‘code’ command in PATH” from the Command Palette.- Wrong Python / packages not found: re-run “Python: Select Interpreter” and make sure the integrated terminal shows the expected environment name in its prompt.
- Formatter not running on save: confirm the Black Formatter (or Ruff) extension is installed and that
editor.formatOnSaveistrue. - Notebook kernel missing: in a
.ipynb, click the kernel picker (top right) and select your environment; installipykernelin that environment if prompted.
References
- VSCode documentation: https://code.visualstudio.com/docs
- Python in VSCode: https://code.visualstudio.com/docs/python/python-tutorial
- Jupyter notebooks in VSCode: https://code.visualstudio.com/docs/datascience/jupyter-notebooks
- Remote development over SSH: https://code.visualstudio.com/docs/remote/ssh
