Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Setting up your coding environment

This guide will help you get ready to run lecture notebooks and complete homework assignments on your own computer.

You’ll need three main tools:

  1. Git: to download and update course materials from GitHub

  2. Python & Conda: to run code and manage packages

  3. JupyterLab: or VS Code as your main coding environment

Quick start (TL;DR)

If you already know what you’re doing, here are the essential commands:

# Clone the repo
git clone https://github.com/UBC-CS/cpsc330-2025W2.git
cd cpsc330-2025W2

# Add conda-forge channel (Miniconda only)
conda config --add channels conda-forge

# Create environment
conda env create -f cpsc330env.yml

# (Optional) Test activating/deactivating the environment
conda activate cpsc330
conda deactivate

# Start JupyterLab from base
jupyter lab

# Or start VS Code from base
code .

⚠️ Normally, you will launch JupyterLab or VS Code from (base) and then select the cpsc330 environment inside those tools. Activating it in the terminal is only needed for testing or if you want to install additional packages in the environment later on.

If you are using Windows, you may want to consider using WSL to run Linux inside Windows. This is especially useful if you are having difficulties setting up your system. For more information, please search for “Windows Subsystem for Linux” (WSL). One recommended Linux distribution is Ubuntu (22.04 LTS or higher). Installing WSL is easy on Windows 11, which allows installation directly from the Microsoft Store. If that does not work for you, here is an alternative installation method covered in this online tutorial.

NOTE 1: Although the course staff are happy to help if you have any technical difficulties, support cannot be guaranteed for WSL or Linux in general. However, if you feel that you can manage it yourself, you are encouraged to do so because the ability to use Linux is certainly a plus. Of course, AI tools should be able to resolve many of the potential issues you may have when using WSL.

NOTE 2: If you are using macOS, you can ignore this tip, as macOS is already a Unix-compliant system.

Step 1: Install Git

We use Git to manage and download course material from GitHub. Follow the Git setup instructions.

Once installed:

git clone https://github.com/UBC-CS/cpsc330-2025W2.git
cd cpsc330-2025W2

To update later:

git pull

⚠️ Tip: Don’t keep personal notes inside this repository. Otherwise, git pull may fail due to conflicts. Keep notes in a separate folder/repo.

Step 2: Install Python and Conda

We use Python 3.12 (Python 2 is not supported). To manage Python and packages, you’ll install a Conda distribution. You have two options:

Download Miniforge here. Choose the installer for your operating system.

Option B: Miniconda

Download Miniconda here. Choose the installer for your operating system.

Step 3: Verify installation

After installation:

You should see (base) at the start of your command line prompt:

(base) yourusername@computer:~$

Check installation:

conda --version
python --version

Expected:

conda: recent version (e.g., 24.x.x)
python: 3.12 or greater

If you see Python 2.7, reinstall with Python 3.12.

Step 4: Configure conda-forge (Miniconda only)

If you installed Miniconda, add the conda-forge channel:

conda config --add channels conda-forge

If you installed Miniforge, you can skip this step (it’s already the default).

Step 5: Create the course environment

A virtual environment keeps course packages isolated from other projects.

  1. Navigate to the course repo if you are not already there. Make sure cpsc330env.yml exists in the repo you cloned:

cd cpsc330-2025W2
ls 
  1. Create the environment.

conda env create -f cpsc330env.yml
  1. (Optional) Test activating and deactivating the environment.

conda activate cpsc330
conda deactivate

Your prompt should return to (base) when deactivated.

✅ You only need to create the environment once. Normally, you will stay in (base) and select the cpsc330 kernel in JupyterLab or VS Code.

  1. Launch JupyterLab (from base environment):

jupyter lab

JupyterLab will open in your browser. At the top-right corner of your notebook, click on the kernel dropdown. Select the kernel named Python [conda env:cpsc330]. Now you’re running the notebook inside the course environment.


Step 6: Using VS Code (alternative to JupyterLab)

Some of you may prefer using VS Code instead of JupyterLab. Both work fine. It’s your choice.

Install VS Code

Open the repo in VS Code

code . 

Select the correct environment

  1. Open the Command Palette (⇧⌘P on macOS, Ctrl+Shift+P on Windows/Linux).

  2. Type Python: Select Interpreter.

  3. Choose the interpreter starting with conda env:cpsc330.

⚠️ If you don’t see the interpreter, restart VS Code after creating the environment.

Running notebooks

Step 7: Troubleshooting

Errors when creating course environment

If conda env create -f cpsc330env.yml fails:

conda install packagename
# or
pip install packagename

Still stuck? Bring your laptop to office hours or tutorials and get help.

(Optional) Learn JupyterLab and Python

If you’re new to JupyterLab and/or Python, here is a short video of an introduction to JupyterLab and Python created by one of the instructors of the course for another course that uses similar tooling.

Credit

These installation instructions are based on the MDS software installation instructions.