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:
Next, ensure that the configuration file is created by running the following in the terminal:
or
depending on the name of your shell. Then
- Install pyenv:
- Ensure that homebrew is installed.
- On macOS:
brew install pyenv
-
On Linux:
curl https://pyenv.run | bash
-
Add pyenv to your shell configuration:
- For bash, add to
~/.bashrc
: - For zsh, add to
~/.zshrc
: -
Source the file to apply the changes:
-
Install Python using pyenv:
-
Verify the installation:
Jupyter Notebook¶
To install Jupyter Notebook, follow these steps:
-
Install Jupyter using pip:
-
Verify the installation:
-
Launch 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:
2. Install radian
With Python installed, install radian using pip:
This command installs radian globally.
3. Install Required R Packages
Open your R console and install the following packages:
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
orr.rterm.linux
to the output ofwhich 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:
- Download the Miniconda Installer:
- Visit the Miniconda download page.
-
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.
-
Install Miniconda:
- Locate the downloaded
.pkg
file in yourDownloads
folder. - Double-click the installer to launch it.
-
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.
-
Initialize Miniconda:
- After installation, open the Terminal application.
- Run the following command to initialize conda:
-
Close and reopen the Terminal to apply the changes.
-
Verify the Installation:
- In the Terminal, check the conda version by running:
- A successful installation will display the conda version number.
- 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.