VS Code + Python or R + GitHub Copilot Setup

Student setup guide for Windows and macOS

Overview

This guide helps you set up:

  1. Visual Studio Code
  2. Either Python or R in VS Code
  3. GitHub Copilot in VS Code

Estimated time: 20-40 minutes.

NoteTerminal commands in this guide

This setup uses several terminal commands (for checks like code --version, python --version, and R --version). If you are new to terminals, read Terminal Basics first.


Before You Start

  • A stable internet connection
  • A GitHub account (create one at github.com if needed)
  • Permission to install software on your computer

Step 1: Install VS Code

Official docs:

  1. Download VS Code from code.visualstudio.com
  2. Run VSCodeUserSetup-{version}.exe
  3. Keep the default User setup install unless you specifically need system-wide install
  4. Reopen terminal after install

Quick check:

code --version
  1. Download VS Code from code.visualstudio.com
  2. Open the .dmg
  3. Drag Visual Studio Code.app into Applications
  4. In VS Code, open Command Palette (Cmd+Shift+P) and run:
    • Shell Command: Install 'code' command in PATH
  5. Restart terminal

Quick check:

code --version

Step 2: Choose One Language Path

You only need one path to start:

  • Option A: Python
  • Option B: R

You can install the other one later.

Option A: Python in VS Code

Official docs:

A1. Install Python

  1. Install the latest stable Python 3 from python.org
  2. Open a new terminal

Check:

py --version

If py is not available, try:

python --version
  1. Install the latest stable Python 3 from python.org
  2. Open a new terminal

Check:

python3 --version

A2. Install Python extension in VS Code

  1. Open VS Code
  2. Open Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Install Python (publisher: Microsoft)
  4. Run Command Palette and select: Python: Select Interpreter
  5. Choose your installed Python interpreter

A3. Test Python

Create hello.py:

print("Hello from Python in VS Code")

Run it with the play button (“Run Python File”) or terminal.


Option B: R in VS Code

Official docs:

B1. Install R

  1. Install R from cloud.r-project.org
  2. During install, keep defaults (recommended: let installer store version info in registry)
  3. Open a new terminal

Check:

R --version
  1. Install R from cloud.r-project.org
  2. Open a new terminal

Check:

R --version

B2. Install R support in VS Code

  1. In VS Code Extensions, install R (publisher: REditorSupport)
  2. Install languageserver in R:
install.packages("languageserver")
  1. In VS Code, open Command Palette and run: R: Create R terminal

B3. Test R

Create hello.R:

x <- 2 + 2
print(x)

Run with Ctrl+Enter (Windows) or Cmd+Enter (macOS) in an R terminal.


Step 3: Set Up GitHub Copilot in VS Code

Official docs:

  1. Open VS Code
  2. In the status bar, click the Copilot icon and choose Use AI Features
  3. Sign in to GitHub when prompted
  4. If you do not already have a plan, you can start with Copilot Free
  5. Open a code file and verify Copilot is active (chat panel opens and/or inline suggestions appear)

Student note

If you are a verified student, apply for the free student Copilot Pro plan (“student plus” upgrade).

Quick quota diff (checked February 17, 2026):

  • Copilot Free: 2,000 code completions/month, 50 chat messages/month, and 50 premium requests/month
  • Student plan (Copilot Pro at $0): unlimited code completions, unlimited chat interactions in IDE/CLI/mobile, and 300 premium requests/month

If you are eligible, this is a large jump in included usage, so it is worth applying early.


Quick Troubleshooting

code command not found

  • Windows: close and reopen terminal after install
  • macOS: run Shell Command: Install 'code' command in PATH from Command Palette, then restart terminal

Python interpreter not found in VS Code

  1. Run Python: Select Interpreter
  2. If nothing appears, reinstall Python and restart VS Code

R extension works but no IntelliSense

Install in R:

install.packages("languageserver")

Then restart VS Code.

Copilot sign-in issues

  1. In VS Code, use Accounts menu to sign out/in GitHub
  2. Check your Copilot plan at github.com/settings/copilot