← All activities
Week 8 · Activity

Activity: Install Python, R and an Editor

Install the two programming languages used in this course, plus an optional code editor, and check that Git Bash can find them. Estimated time: 20 minutes.

Reading: the Using GitHub and AI chapter uses these tools throughout.

📋 What to do

  1. Install an editor (optional, any one). An editor makes writing and running code far easier, but you do not need a specific one. Pick whichever you like: Positron (built for data science, and a good fit for R and Python; RStudio suits R in the same way), VS Code (a good fit for Python and R alike), or Cursor (an AI-assisted editor). One editor is enough. If you choose RStudio, it installs R for you.
  2. Install Python. Go to the Python download page, download the latest version for your operating system, and run the installer. On Windows, tick “Add Python to PATH” on the first installer screen — this is the step people most often miss.
  3. Install R. Go to the CRAN download page, choose a mirror close to you, download R for your operating system, and run the installer with the default options. (Skip this step if RStudio or Positron already gave you R.)
  4. Tell Git Bash where Python and R are (Windows). Open Git Bash and add the two folders to your PATH in your ~/.bashrc file. Edit the version numbers and your username to match what you installed; the lines below are an example.
    notepad ~/.bashrc
    
    # paste lines like these, adjusting to your install, then save and close:
    export PATH="$PATH:/c/Users/YOUR_USERNAME/AppData/Local/Programs/Python/Python312"
    export PATH="$PATH:/c/Program Files/R/R-4.4.1/bin"
    # optional: where R keeps the packages you install
    export R_LIBS_USER="/c/Users/YOUR_USERNAME/AppData/Local/R/win-library/4.4"
    Then load the new settings into your current session:
    source ~/.bashrc
    On macOS the installers set this up for you; skip to the next step.
  5. Check both installs. In Git Bash (Terminal on macOS), run these two commands. Each should print a version number, not an error.
    python --version      # on macOS use: python3 --version
    R --version
  6. Take a screenshot showing the output of both commands in one window, and paste it into the Canvas text submission box.

Stuck? “command not found” almost always means the folder is not on your PATH yet. Check the folder names in your .bashrc against what is actually installed on your computer, close and reopen Git Bash, and try again.

📮 Submit

Submit on Canvas (1 pt) — graded on completion; your deadline is on the Canvas assignment. Submit a screenshot of both version outputs.

Note: this page reproduces the activity instructions so you can find them again after class, and it is the version kept current — download links and helper links are updated right here. Submit on Canvas; the due date and your grade live there.