This repository contains a starter Python environment for running Jupyter notebooks used in the Computational Models of Social Cognition course.
For this course, you need a Python environment that lets you run Jupyter Notebooks with memo models. While this guide suggests creating an environment that matches the one I'll be using for the tutorials, you can also use a more minimal setup. As long as you can successfully run notebooks like comosoco/installation-test.ipynb, your setup should be sufficient.
Homebrew is a package manager for MacOS that simplifies software installation and management.
Follow the installation instructions on https://brew.sh
Verify the installation:
brew --versionI can't or don't want to use homebrew!
No problem, it just makes it easier to install and remove things on MacOS.git is a version control system that helps manage code. Here's how to install it:
With Homebrew:
brew install gitWithout Homebrew:
Follow the installation instructions on https://git-scm.com/download/win
Verify the installation:
git --versionI can't or don't want to use git!
But git is great! Ok, though, you can skip it for now and download the repository directly as a ZIP file (see "Getting the Repository" section below).Astral uv is a fast Python package installer that we'll use to set up the environment.
With Homebrew:
brew install uvWithout Homebrew:
Follow the install instructions on https://docs.astral.sh/uv/getting-started/installation/
Verify the installation:
uv --versionI can't or don't want to use uv!
Ok, we can work around that.Task is a task runner that simplifies common commands. While Task is not specific to MacOS, at the moment this repository only supports Task on MacOS.
With Homebrew:
brew install go-taskWithout Homebrew:
Follow the installation instructions on https://taskfile.dev/installation/
Verify the installation:
task --versionI can't or don't want to use Task!
No problem, it's just for convenience.VS Code is the recommended editor for this course:
- Download VS Code from https://code.visualstudio.com
- Install the downloaded file
I can't or don't want to use VS Code!
You can use any editor that supports Jupyter notebooks, but this README only gives instructions for VS Code.Choose one of these methods:
Option 1: Fork and Clone (Recommended)
- Create a GitHub account if you don't have one
- Go to this repository https://github.com/daeh/comosoco-env
- Click the "Fork" button in the top-right corner
- Clone your fork:
git clone https://github.com/YOUR-USERNAME/comosoco-env.git cd comosoco-env
Option 2: Direct Clone
git clone https://github.com/daeh/comosoco-env.git
cd comosoco-envOption 3: Direct Download
- Visit https://github.com/daeh/comosoco-env
- Click the green "Code" button
- Select "Download ZIP"
- Extract the ZIP file
- Navigate to the
comosoco-envfolder in your terminal
Make sure you're in the comosoco-env directory, then choose one method:
Option 1: Using Task (Easiest, MacOS)
task installOption 2: Using uv
uv syncOption 3: Using pip
1, Make a virtual environment:
python -m venv .venv- Activate the environment:
MacOS/Linux:
source .venv/bin/activateWindows (Command Prompt):
.venv\Scripts\activate.batWindows (PowerShell):
.venv\Scripts\Activate.ps1- Install packages:
pip install -r requirements-standard.txtIf you encounter issues, try using requirements-minimal.txt instead:
pip install -r requirements-minimal.txt-
Open the VS Code application
-
Open
VSCProject.code-workspace -
When prompted, install recommended extensions
-
Troubleshooting: If you don't see a prompt to install the recommended extensions, make sure you've correctly open the
VSCProject.code-workspacefile. You should see "comosoco" as the window name. -
Troubleshooting: If you're sure you have the workspace open, you can manually install the extensions by searching for
@recommendedin the Extension Pane
-
-
Open
comosoco/installation-test.ipynb -
Set the Jupyter notebook to use the
.venvpython incomosoco-env- See below for screen shots.
-
Run all cells in the notebook - if they complete without error, your setup is working!