Setting Up Your Data Science Tool Stack

Read and complete this guide as part of your first homework. We will also be reviewing this in class.

Your stack:

If you already have these installed, you can skip the setup

Where to go:

Overview and Core Concepts

What is an interpreter?

  • An interpreter is a program that reads your source code and runs it directly, line by line, at run time.
  • There is no separate “build” step: you hand it a script and it executes right away.
  • Contrast: compiled languages (C, C++) are first translated into a standalone executable, then run.
  • R and Python are interpreted languages: your code runs through the R or python interpreter program.
  • Takeaway: you must install the interpreter; that is the thing that actually runs your code.

Common file types: Markdown, .qmd, and .ipynb

  • Markdown (.md): plain text with lightweight formatting; # for headers, **bold**, - for lists; renders to HTML or PDF.
  • Jupyter notebook (.ipynb): a file of cells that mixes Markdown (text) and code; outputs are saved inline; stored as JSON.
  • Quarto document (.qmd): plain-text Markdown plus executable code chunks; rendered by Quarto to HTML, PDF, Word, or slides.
  • Shared idea: all three combine human instructions with code, so narrative, analysis, and results live in one document.
  • Key difference: .ipynb is cell-based JSON; .qmd is clean Markdown text and works with R, Python, and Julia.
  • Scripts:
    • .py: a Python script file (.py), which runs python code line by line.
    • .R: an R script file (.R), which runs R code line by line.

Environments and Conda

  • Conda is both a package manager and an environment manager, used mainly for Python.
  • We install it through Miniforge, a minimal Conda that uses the free conda-forge package channel by default.
  • An environment is an isolated set of packages and versions, so one project does not break another.
  • We will create one course environment, named dsan, and use it everywhere.

The plan (all platforms)

  1. Install the language interpreters: R, and Python by way of Conda (Miniforge).
  2. Install the editors: RStudio and VS Code.
  3. Install Quarto and the VS Code extensions.
  4. Create one Conda environment, then verify everything runs.

macOS Setup

Before you start (macOS)

  • Most current Macs use Apple Silicon (M1 through M4). Check with the Apple menu, then “About This Mac”.
  • Apple Silicon: download the “Apple silicon” or “arm64” installers.
  • Older Intel Macs: download the “Intel” or “x86_64” installers.
  • Your terminal shell is zsh by default; the installers configure it for you.

Step 1: Install R, then RStudio

Check first if you already have R and RStudio installed: in Terminal run R --version (for R) and ls /Applications | grep -i RStudio (for RStudio). Install whichever is missing.

  • Install R before RStudio so RStudio can find it.
  • R: go to cran.r-project.org, open Download R for macOS, choose the .pkg that matches your chip, then run it.
  • RStudio: download RStudio Desktop, open the .dmg, drag RStudio into Applications.
  • Open RStudio; it should detect R automatically.

Step 2: Install Miniforge (Python)

Check first if you already have Conda installed: in Terminal run conda --version. If you see a version, skip this step.

  • Download the macOS installer from conda-forge.org/download, choosing the .pkg (graphical) for your chip. Command-line alternative:
curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
bash Miniforge3-MacOSX-arm64.sh
  • On Intel Macs, use the x86_64 file instead. Reopen Terminal, then run conda --version.
  • conda-forge is already the default channel, so no further channel setup is needed.

Step 3: Install VS Code and extensions

Check first if you already have VS Code installed: run code --version, or look for Visual Studio Code in your Applications folder. If present, skip the download and go straight to the extensions.

  • Download VS Code from code.visualstudio.com/download, open the .zip, move “Visual Studio Code” into Applications.
  • Open VS Code, go to the Extensions panel, and install: Python, Jupyter, Quarto. Optional: R.
  • Optional convenience: Command Palette (Cmd+Shift+P), run “Shell Command: Install ‘code’ command in PATH”.

Step 4: Install Quarto

Check first if you already have Quarto installed: run quarto --version. If you see a version, skip this step.

  • RStudio already bundles Quarto; for VS Code, install the standalone Quarto CLI as well.
  • Download the macOS .pkg from quarto.org/docs/download and run it.
  • Verify in Terminal:
quarto check

Step 5: Create the course environment

Check first if you already have the dsan environment: run conda env list. If dsan is listed, skip creating it and just run conda activate dsan.

  • In Terminal:
conda create -n dsan python=3.12 jupyterlab pandas numpy matplotlib
conda activate dsan
  • In VS Code, open a notebook or Python file, then select the environment: Command Palette, “Python: Select Interpreter”, choose dsan.

Verify (macOS)

Run each command; you should see version numbers with no errors:

R --version
python --version
conda --version
quarto --version

Then open RStudio, open VS Code, create a test .ipynb, and run a cell.

Windows Setup (Part 1): Native Windows

Two paths on Windows

  • Native Windows: install everything directly on Windows; this is the simplest way to start.
  • WSL (Ubuntu Linux inside Windows): a Linux environment that matches real servers; covered in Part 2.
  • You do not need both. Start with native Windows unless your instructor asks for WSL.

Step 1: Install R, then RStudio

Check first if you already have R and RStudio installed: in PowerShell run dir "C:\Program Files\R" (for R) and dir "C:\Program Files\RStudio" (for RStudio). A listed folder means it is installed. Install whichever is missing.

Step 2: Install Miniforge (Python)

Check first if you already have Conda installed: open the Start Menu and look for “Miniforge Prompt” (or an existing “Anaconda Prompt”). If one exists, Conda is already installed; skip this step.

  • Download the Windows .exe from conda-forge.org/download. Direct file: Miniforge3-Windows-x86_64.exe.
  • Run it, “Just Me”; leave “Add to PATH” unchecked.
  • Use “Miniforge Prompt” from the Start Menu whenever you run conda commands, then run conda --version.
  • conda-forge is already the default channel, so no further channel setup is needed.

Step 3: Install VS Code and extensions

Check first if you already have VS Code installed: in PowerShell run code --version. If you see a version, skip the download and go straight to the extensions.

  • Download the Windows “User Installer” from code.visualstudio.com/download, then run it (no admin needed).
  • In the VS Code Extensions panel, install: Python, Jupyter, Quarto. Optional: R.

Step 4: Install Quarto

Check first if you already have Quarto installed: in the Miniforge Prompt run quarto --version. If you see a version, skip this step.

  • RStudio already bundles Quarto; for VS Code, install the standalone Quarto CLI as well.
  • Download the Windows .msi from quarto.org/docs/download and run it.
  • Verify:
quarto check

Step 5: Create the course environment

Check first if you already have the dsan environment: in the Miniforge Prompt run conda env list. If dsan is listed, skip creating it and just run conda activate dsan.

  • In the Miniforge Prompt:
conda create -n dsan python=3.12 jupyterlab pandas numpy matplotlib
conda activate dsan
  • In VS Code: Command Palette (Ctrl+Shift+P), “Python: Select Interpreter”, choose dsan.

Verify (native Windows)

Run in the Miniforge Prompt:

R --version
python --version
conda --version
quarto --version

Common fix: if conda is “not recognized” in a plain PowerShell window, use the Miniforge Prompt instead, or run conda init powershell once and reopen the window.

Windows Setup (Part 2): WSL (Ubuntu)

What WSL is

  • WSL runs a real Ubuntu Linux inside Windows; you get a Linux command line and Linux tools.
  • It is a good match for servers and cloud environments, and is widely used in data science.
  • You will edit code with VS Code on Windows, connected into Ubuntu.
  • Reference: Microsoft’s WSL install guide.

Step 1: Install WSL

Check first if you already have WSL installed: in PowerShell run wsl -l -v. If Ubuntu is listed, skip to Step 2.

  • Open PowerShell as Administrator (right-click, “Run as administrator”).
  • Install WSL together with Ubuntu:
wsl --install
  • Restart your computer when prompted.
  • On the first launch of Ubuntu, create a UNIX username and password (separate from your Windows login).
  • If WSL fails to start, enable virtualization in your BIOS or UEFI settings, then retry.

Step 2: Update Ubuntu

  • In the Ubuntu terminal, refresh the system packages:
sudo apt update && sudo apt upgrade -y

Step 3: Connect VS Code to WSL

Check first if you already have VS Code installed: in Windows PowerShell run code --version. If missing, install VS Code on Windows (Part 1, Step 3).

  • In VS Code, install the WSL extension.
  • From Ubuntu, make a project folder and open it in VS Code:
mkdir -p ~/dsan && cd ~/dsan
code .
  • VS Code reopens “connected to WSL”; when prompted, install the Python, Jupyter, and Quarto extensions inside WSL too.

Step 4: Install Miniforge in Ubuntu

Check first if you already have Conda installed: in Ubuntu run conda --version. If you see a version, skip this step.

  • Download and run the Linux installer (use the aarch64 file on Arm-based Windows):
cd ~
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
bash Miniforge3-Linux-x86_64.sh
  • Accept the license and default location, answer “yes” to initialize, then close and reopen the terminal.
  • conda-forge is already the default channel, so no further channel setup is needed.

Step 5: Create the course environment (with Quarto and Jupyter)

Check first if you already have the dsan environment: in Ubuntu run conda env list. If dsan is listed, skip creating it and just run conda activate dsan.

  • Create everything in one environment:
conda create -n dsan python=3.12 jupyterlab quarto pandas numpy matplotlib
conda activate dsan
quarto check
  • In VS Code (connected to WSL), select the dsan interpreter and the dsan notebook kernel.
  • Alternative Quarto install: the official Linux .deb at quarto.org/docs/download.

Step 6: R in Ubuntu (optional)

Check first if you already have R installed: in Ubuntu run R --version. If you see a version, R is installed.

  • For Python-first work you can skip R here and use native RStudio (Part 1) for R.
  • To install R inside WSL:
sudo apt install -y r-base
  • Use R through the VS Code R extension, or the radian console.
  • The RStudio graphical app does not run cleanly inside WSL; for the RStudio experience, use native RStudio from Part 1.

Verify (WSL)

  • In the Ubuntu terminal:
python --version
conda --version
quarto --version
  • In VS Code (connected to WSL), open a .ipynb, select the dsan kernel, and run a cell.

Optional: Command Line and File Paths

Why this matters

  • Tools like Conda and Quarto often run from a terminal, so a little navigation goes a long way.
  • In VS Code, use the built-in terminal (Terminal menu, “New Terminal”) so your editor and command line share the same folder.

Core commands

  • pwd (macOS, Linux) or cd with no argument (Windows): show the current folder.
  • ls (macOS, Linux) or dir (Windows): list the folder’s contents.
  • cd foldername: enter a folder; cd ..: go up one level.
  • mkdir name: make a new folder.

Paths

  • Absolute path: the full location from the root, for example /Users/you/dsan or C:\Users\you\dsan.
  • Relative path: measured from where you are now, for example data/file.csv.
  • Home shortcut: ~ on macOS and Linux.
  • PATH (the environment variable): the list of folders the system searches for programs; this is why “add to PATH” during install matters.

You Are Ready

Before lecture, confirm all of the following:

  • R and RStudio open and run.
  • Conda works, and conda activate dsan succeeds.
  • VS Code runs a notebook cell using the dsan kernel.
  • quarto check passes.

Bring your laptop with these done. If a step failed, copy the exact error message and ask before class.