Skip to content

Installation Guide for the Course

Operating System

Most of the materials in this course are platform-independent. However, most of the instructions are based on Linux or macOS. If you are using Windows, you can either find the corresponding Windows instructions online or use WSL2 to set up a Linux virtual machine. See a tutorial here.

Install IDE

For your local Integrated Development Environment (IDE), we suggest using Visual Studio Code (VS Code) - a lightweight, open-source editor. Head to the VS Code official website to download and install the version that matches your operating system.

Create a GitHub account

Github Copilot

We recommend using the AI assistant Github Copilot or other similar tools. As Harvard students, GitHub Copilot you may apply for a free license of GitHub Copilot by following the steps here. Note that you will need to upload proof of enrollment: you can use a picture of your student ID your GSAS enrollment documentation (which can be found in my.harvard).

To install Github Copilot in VS Code, you can search for Github Copilot in the VS Code extension marketplace and install it.

We also strongly recommend you to read the VS Code tutorial for Github Copilot. It introduces many useful features of Github Copilot.

Other AI-Copilot resources

We also recommend (though not required) to install the following AI-Copilot tools: - Cursor - Windsurf

Install language environments

Python

We suggest using pyenv to install python for better version management. For the following, identify the name of the shell (usually bash or zsh) by running the following in your terminal:

ps $$

Next, ensure that the configuration file is created by running the following in the terminal:

touch ~/.bashrc

or

touch ~/.zshrc

depending on the name of your shell. Then

  1. Install pyenv:
  2. Ensure that homebrew is installed.
  3. On macOS: brew install pyenv
  4. On Linux: curl https://pyenv.run | bash

  5. Add pyenv to your shell configuration:

  6. For bash, add to ~/.bashrc:
    export PYENV_ROOT="$HOME/.pyenv"
    export PATH="$PYENV_ROOT/bin:$PATH"
    eval "$(pyenv init -)"
    
  7. For zsh, add to ~/.zshrc:
    export PYENV_ROOT="$HOME/.pyenv"
    export PATH="$PYENV_ROOT/bin:$PATH"
    eval "$(pyenv init -)"
    
  8. Source the file to apply the changes:

    source ~/.bashrc  # For bash
    source ~/.zshrc   # For zsh
    

  9. Install Python using pyenv:

    pyenv install 3.10.0  # Install Python 3.10.0
    pyenv global 3.10.0   # Set as default Python version
    

  10. Verify the installation:

    python --version  # Should show Python 3.10.0
    

Jupyter Notebook

To install Jupyter Notebook, follow these steps:

  1. Install Jupyter using pip:

    pip install notebook
    

  2. Verify the installation:

    jupyter notebook --version
    

  3. Launch Jupyter Notebook:

    jupyter notebook
    
    This will open Jupyter Notebook in your default web browser.

Check the VS Code tutorial for using Jupyter in VS Code here.

For more information, refer to the official Jupyter documentation.

VS Code Python

We suggest you to read the official tutorial for using the Python extension in VS Code. Besides Python and Jupyter extensions, we also suggest installing the following python related extensions:

  • Pylance: it has the ability to supercharge your Python IntelliSense experience with rich type information, helping you write better code faster.
  • Pylint: it is a static type checker and linting tool for Python.

R

You can use other R IDEs like RStudio, but we suggest using VS Code with the R extension to better integrate with AI copilot. You can find the tutorial of VS Code R extension here. To set up R in Visual Studio Code, follow these steps:

1. Install R

Ensure that R (version 3.4.0 or higher) is installed on your system:

  • macOS: Download the installer from CRAN and follow the installation prompts.
  • Linux: Use your package manager to install R. For example, on Ubuntu:
sudo apt-get update
sudo apt-get install r-base

2. Install radian

With Python installed, install radian using pip:

pip install -U radian

This command installs radian globally.

3. Install Required R Packages

Open your R console and install the following packages:

install.packages("languageserver")
install.packages("httpgd")
  • languageserver: Provides language support for R in VS Code.
  • httpgd: Enables an interactive plot viewer in VS Code.

4. Install the R Extension in VS Code

In VS Code:

  • Click on the Extensions view icon on the Sidebar or press Ctrl+Shift+X.
  • Search for "R" and install the extension by Yuki Ueda.

5. Configure VS Code Settings

To integrate radian with VS Code:

  • Open VS Code settings:
  • Click on the gear icon in the lower-left corner and select "Settings," or press Ctrl+,.
  • In the search bar, type r.rterm.
  • Set the path to radian:
  • macOS/Linux: Set r.rterm.mac or r.rterm.linux to the output of which radian (e.g., /usr/local/bin/radian).
  • Enable bracketed paste mode:
  • Search for r.bracketedPaste and ensure it's checked.
  • Search for r.plot.useHttpgd and enable it to use the httpgd plot viewer.

Optional software

Cursor

Cursor is a new generation AI-powered IDE that can help you write code faster and more efficiently. All the basic features of Cursor is same as VS Code. You can download Cursor from the official website and install it.

Conda

We also suggest installing mini-conda for data analysis projects. To install Miniconda on macOS, follow these steps:

  1. Download the Miniconda Installer:
  2. Visit the Miniconda download page.
  3. Choose the installer that matches your macOS architecture:

    • For Apple Silicon (M1, M2, etc.): Select the "Miniconda3 macOS Apple M1 64-bit pkg" installer.
    • For Intel-based Macs: Select the "Miniconda3 macOS Intel x86 64-bit pkg" installer.
  4. Install Miniconda:

  5. Locate the downloaded .pkg file in your Downloads folder.
  6. Double-click the installer to launch it.
  7. Follow the on-screen instructions:

    • Read and agree to the license agreement.
    • Choose the installation type:
    • Install for all users of this computer (Recommended): Installs Miniconda into /opt/miniconda3 for all users.
    • Install just for me: Installs Miniconda into your home directory.
    • Click "Install" to proceed.
  8. Initialize Miniconda:

  9. After installation, open the Terminal application.
  10. Run the following command to initialize conda:
    conda init
    
  11. Close and reopen the Terminal to apply the changes.

  12. Verify the Installation:

  13. In the Terminal, check the conda version by running:
    conda --version
    
  14. A successful installation will display the conda version number.
  15. Run conda deactivate to leave the environment.

For more detailed information, refer to the official Miniconda installation documentation.

Cluster

The cluster computing of the class is supported by Harvard Academic Technologies Group similar to the FAS-RC cluster. Check the Academic Technologies Group official website for more information.