From 9034e09e176b5c5d940a475b53352bbef1e711ae Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Sat, 8 May 2021 19:03:06 +0100 Subject: [PATCH] Try a different method to find out if pip is installed --- cibuildwheel/windows.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py index 7dbb3c39..dc740f79 100644 --- a/cibuildwheel/windows.py +++ b/cibuildwheel/windows.py @@ -178,7 +178,11 @@ def setup_python( # make sure pip is installed and available on PATH if not (installation_path / "Scripts" / "pip.exe").exists(): # perhaps pip is installed, but not available as 'pip.exe'... - if (installation_path / "Scripts" / "pip3.exe").exists(): + pip_is_installed = ( + subprocess.run(["python", "-m", "pip", "--version"], env=env, cwd="C:\\cibw").returncode + == 0 + ) + if pip_is_installed: # if it's there, remove that version of pip. call(["python", "-m", "pip", "uninstall", "--yes", "pip"], env=env, cwd="C:\\cibw")