Session 2 — Clone, Build, and Run
Introduction
Before you start: Confirm you completed all steps in Environment Setup. Open Git Bash and run the following commands:
conda --versiongit --versiongit config --list
All three should return output with no errors. If any fail, work through session_00.md before continuing.
You should have your tools installed and your fork created. This session connects everything: you will clone your fork to your computer, create the conda environment that all remaining sessions depend on, and run your first Python script inside VS Code. By the end, you will have made your first commit and push to GitHub.
This session has two parts. Steps 1–3 set up your environment. Steps 1-3 must be working before any later session, so if you get stuck here, ask for help right away. Step 4 walks through the Git commit-and-push workflow you will repeat each session; if you run low on time, you can finish it at office hours without falling behind.
VS Code Orientation
VS Code has four areas you will use in every session.
Explorer (left sidebar, Ctrl+Shift+E) is the file navigator. It shows every file and folder in your project. Click any file to open it in the editor. Right-click to create, rename, or delete files.
Editor (center) is where you read and write code. Clicking a file in the Explorer opens it here. You can have multiple files open as tabs.
Terminal (bottom panel, Ctrl+`) is the built-in command line. This is where you run Python scripts, activate conda environments, and execute Git commands. All terminal commands in this workshop are typed here.
Source Control (left sidebar, Ctrl+Shift+G) is the Git interface. It shows which files have changed since your last commit. You can stage, commit, and review diffs here, although this workshop will use Git commands in the terminal instead.
Step 1 — Clone Your Fork
Cloning downloads a copy of your fork from GitHub to your local machine.
Open VS Code.
Press
Ctrl+Shift+Pto open the Command Palette.Type Git: Clone and press Enter.
Paste your fork URL, replacing
YOUR-USERNAMEwith your GitHub username:https://github.com/YOUR-USERNAME/automating-analytics-workshop.gitA file picker opens — choose a destination folder, for example your Desktop.
When VS Code asks “Would you like to open the cloned repository?”, click Open.
The automating-analytics-workshop folder will appear in the Explorer pane on the left.
Open Git Bash from the Windows Start menu.
Navigate to the folder where you want to store the project — for example, your Desktop:
cd DesktopClone your fork, replacing
YOUR-USERNAMEwith your GitHub username:git clone https://github.com/YOUR-USERNAME/automating-analytics-workshop.gitNavigate into the folder and verify the files are there:
cd automating-analytics-workshop lsYou should see the top-level repo contents, including the
student_report/folder.Open the folder in VS Code:
code .Confirm Git Bash is your terminal.
- Open the built-in terminal with
Ctrl+`. - Confirm the terminal panel shows bash in the upper right corner.
- If you see PowerShell instead, click the dropdown arrow (
∨) next to the+icon, select Git Bash, and set it as the default viaCtrl+Shift+P→ Terminal: Select Default Profile → Git Bash.
- If you see PowerShell instead, click the dropdown arrow (
- Open the built-in terminal with
Step 2 — Create the Conda Environment
The repo includes student_report/environment.yml, which defines every package this workshop uses. Create the environment from it:
conda env create -f student_report/environment.ymlThis downloads and installs all dependencies. It will take a few minutes the first time. When it finishes you should see:
# To activate this environment, use
# $ conda activate student-reportActivate the environment:
conda activate student-reportYour terminal prompt should change to show (student-report) at the beginning. Verify Python is coming from the right place:
python --versionYou should see Python 3.11.x.
Troubleshooting —
conda activatenot recognized: Runconda init bashonce, then close and reopen the terminal. Tryconda activate student-reportagain.
Step 3 — Select the Python Interpreter in VS Code
VS Code needs to know which Python to use:
- Press
Ctrl+Shift+Pto open the Command Palette - Type Python: Select Interpreter and press Enter
- Select the entry that shows student-report:
Python 3.11.x ('student-report': conda)
If student-report does not appear in the list, click Enter interpreter path and paste the path manually:
C:\Users\YOUR-USERNAME\miniconda3\envs\student-report\python.exeReplace YOUR-USERNAME with your Windows username. Once selected, the interpreter name appears in the VS Code status bar at the bottom right.
Checkpoint — the essential setup is done. If Steps 1–3 are working — fork cloned,
(student-report)shows in your terminal prompt, the VS Code interpreter is set, andpython --versionreports 3.11.x — you are ready for every Phase 1 session. Step 4 below is the Git workflow you will reuse each week. It is important, but if you are short on time or hit a credential snag, you can complete it at office hours. Do not let a Git hiccup stall the rest of the class: flag the instructor and keep moving.
Step 4 — Your First Commit
You will create a small Python script, run it, and commit it to your fork. This is the same workflow you will use every session.
Create a scratch file
In the Explorer pane, right-click in the file list and choose New File. Name it scratch.py and add:
import pandas as pd
print("Environment is working!")
print(f"pandas version: {pd.__version__}")Run it
In the VS Code terminal (confirm (student-report) is active) and run:
python scratch.pyYou should see:
Environment is working!
pandas version: 2.x.x
If you see ModuleNotFoundError: No module named 'pandas', the wrong Python interpreter is active. Re-check Step 3.
Stage, commit, and push
Using VS Code
- Open the Source Control pane with
Ctrl+Shift+G. You should seescratch.pylisted under Changes. - Click the + icon next to
scratch.pyto stage it. - Type a commit message in the box at the top — for example:
add scratch.py to test environment - Click Commit.
- Click Sync Changes (or the ↑ icon in the status bar) to push to GitHub.
The first time you push, Git Credential Manager will open a browser window asking you to sign in to GitHub. Complete the sign-in, then return to VS Code.
Alternative — Git Bash
Check what Git sees:
git statusscratch.py is listed as untracked. Stage it:
git add scratch.pyCommit:
git commit -m "add scratch.py to test environment"Push to GitHub:
git pushThe first time you push, Git Credential Manager will open a browser window asking you to sign in to GitHub. Complete the sign-in, then return to the terminal.
Visit https://github.com/YOUR-USERNAME/automating-analytics-workshop — you should see scratch.py in your fork.
What You Have Now
| Status | |
|---|---|
| Fork cloned locally | ✓ |
student-report conda environment created and active |
✓ |
| VS Code using the correct Python interpreter | ✓ |
| First commit and push to GitHub | ✓ |
This setup carries through every remaining session. You will activate student-report, open the terminal in VS Code, write code, and commit. This will be the same loop each time.