From c5abafbd2fd56a72a00e2d028ba6063b7cda9a2e Mon Sep 17 00:00:00 2001 From: Tim Felgentreff Date: Fri, 30 Jun 2023 17:18:19 +0200 Subject: [PATCH] make sure pip exists in manylinux installation when dynamically downloading python --- cibuildwheel/linux.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cibuildwheel/linux.py b/cibuildwheel/linux.py index 668511f22..c4a1d67f2 100644 --- a/cibuildwheel/linux.py +++ b/cibuildwheel/linux.py @@ -142,6 +142,12 @@ def install_python(container: OCIContainer, config: PythonConfiguration) -> bool # name is inconsistent with the archive name call("tar", "-C", installation_path, "--strip-components=1", "-xzf", downloaded_archive) downloaded_archive.unlink() + # make sure pip and wheel are available + bin_path = installation_path / "bin" + call(bin_path / "python", "-s", "-m", "ensurepip") + if not (bin_path / "pip").exists(): + call("cp", bin_path / "pip3", bin_path / "pip") + call(bin_path / "python", "-s", "-m", "pip", "install", "wheel") container.copy_into(installation_path, config.path) try: container.call(["test", "-x", config.path / "bin" / "python"])