From f16110717beb29864fb561e7e443105cda71fa77 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 20 Jun 2025 14:22:31 -0700 Subject: [PATCH] fix: Ensure pip is available before installation --- aider/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aider/utils.py b/aider/utils.py index fd534c315..834ffa195 100644 --- a/aider/utils.py +++ b/aider/utils.py @@ -211,6 +211,13 @@ def run_install(cmd): print() print("Installing:", printable_shell_command(cmd)) + # First ensure pip is available + ensurepip_cmd = [sys.executable, "-m", "ensurepip", "--upgrade"] + try: + subprocess.run(ensurepip_cmd, capture_output=True, check=False) + except Exception: + pass # Continue even if ensurepip fails + try: output = [] process = subprocess.Popen(