From f668826f79c2ecc9a0e0edab15a64db7f4131774 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Wed, 8 Apr 2026 21:17:52 -0400 Subject: [PATCH] fix: bootstrap pip via ensurepip if missing from venv On Arch Linux, venvs can be created without pip seeded in. Detect the missing module before attempting pip install and recover with `python -m ensurepip --upgrade`. Co-Authored-By: Claude Sonnet 4.6 --- install.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/install.py b/install.py index 1e1adf0..5ecaa71 100755 --- a/install.py +++ b/install.py @@ -117,6 +117,12 @@ def setup_venv(dry_run=False): # Always (re-)install requirements so updates are picked up if not dry_run: + # Bootstrap pip if the venv was created without it (common on Arch) + code, _, _ = run_quiet([str(VENV_PYTHON), "-m", "pip", "--version"]) + if code != 0: + info("pip not found in venv — bootstrapping via ensurepip …") + run([str(VENV_PYTHON), "-m", "ensurepip", "--upgrade"]) + info("Installing / updating requirements …") run([str(VENV_PYTHON), "-m", "pip", "install", "--quiet", "--upgrade", "pip"]) run([str(VENV_PYTHON), "-m", "pip", "install", "--quiet", "-r", str(REQUIREMENTS)])