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: Choose Your OS

Select your OS once, then stay in that tab for the language setup so you only see one platform path.

Official docs:

Install VS Code

  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

Step 2: Choose One Language Path

Pick one language to start. You can install the other one later.

Official docs:

Install Python + VS Code support
  1. Install the latest stable Python 3 from python.org
  2. Open a new terminal and check:
py --version

If py is not available, try:

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

Create hello.py:

print("Hello from Python in VS Code")

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

Official docs:

Install R + VS Code support
  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 and check:
R --version
  1. In VS Code Extensions, install R (publisher: REditorSupport)
  2. Install languageserver in R:
install.packages("languageserver")

This package enables IntelliSense-style features in VS Code (autocomplete, diagnostics, and hover help).

  1. In VS Code, open Command Palette and run: R: Create R terminal
Test R

Create hello.R:

x <- 2 + 2
print(x)

Run with Ctrl+Enter in an R terminal.

Install VS Code

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

Quick check:

code --version

Step 2: Choose One Language Path

Pick one language to start. You can install the other one later.

Official docs:

Install Python + VS Code support
  1. Install the latest stable Python 3 from python.org
  2. Open a new terminal and check:
python3 --version
Note

If you are on macOS, you may be prompted to install Xcode Command Line Tools when running Python or opening a terminal for the first time. Follow the prompts to install if needed.

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

Create hello.py:

print("Hello from Python in VS Code")

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

Official docs:

Install R + VS Code support
  1. Install R from cloud.r-project.org
  2. Open a new terminal and check:
R --version
  1. In VS Code Extensions, install R (publisher: REditorSupport)
  2. Install languageserver in R:
install.packages("languageserver")

This package enables IntelliSense-style features in VS Code (autocomplete, diagnostics, and hover help).

  1. In VS Code, open Command Palette and run: R: Create R terminal
Test R

Create hello.R:

x <- 2 + 2
print(x)

Run with Cmd+Enter in an R terminal.


Step 2: 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 not found (Windows)

You might need to add the R.exe location such as ‘C:Files.3’ to ‘PATH’

Start → search “Environment Variables” → “Edit the system environment variables”, 
Environment Variables…
Under your user (or System) variables: Path → Edit → New
Paste the ...\bin path → OK → reopen cmd

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