- Windows: Python 3.11.9
- Linux: Python 3.11.9 (or
python3.11from package manager) - macOS: Python 3.11.9 (or
python3.11via Homebrew)
Before running any Python command, ensure the virtual environment exists and is activated.
# Windows
py -3.11 -m venv .venv
# Linux / macOS
python3.11 -m venv .venvAlways activate before running Python:
# Windows (Git Bash / MSYS2)
source .venv/Scripts/activate
# Linux / macOS
source .venv/bin/activateAfter activation, install required packages:
pip install --upgrade pip
pip install matplotlib numpy tiktoken- Never use the system Python. Always run Python inside the
.venvenvironment. - Call the venv Python directly by path — no activation needed, works regardless of shell
state, and survives subshell boundaries. Resolve the OS-correct path with:
Use the same pattern for pip:
PYTHON="$([ -f .venv/Scripts/python ] && echo .venv/Scripts/python || echo .venv/bin/python)" $PYTHON benchmark/charts.py benchmark/results
PIP="$([ -f .venv/Scripts/pip ] && echo .venv/Scripts/pip || echo .venv/bin/pip)" $PIP install matplotlib
.venv/Scripts/python— Windows (Git Bash / MSYS2 / PowerShell).venv/bin/python— Linux / macOS
- If
.venv/does not exist, create it before proceeding. Do not skip this step. - If a package is missing, install it via the venv pip (see rule 2).
- Do not add
.venv/to version control. It should be in.gitignore.