Try to force pip to install itself on PATH
This commit is contained in:
+10
-3
@@ -173,9 +173,18 @@ def setup_python(
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
# make sure pip is installed
|
||||
log.step("Installing build tools...")
|
||||
|
||||
# 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():
|
||||
# if it's there, remove that version of pip.
|
||||
call(["python", "-m", "pip", "uninstall", "pip"])
|
||||
|
||||
# Then reinstall. '--default-pip' ensures that it's installed as 'pip.exe'
|
||||
call(["python", "-m", "ensurepip", "--default-pip"], env=env, cwd="C:\\cibw")
|
||||
|
||||
assert (installation_path / "Scripts" / "pip.exe").exists()
|
||||
where_pip = (
|
||||
subprocess.run(
|
||||
@@ -191,8 +200,6 @@ def setup_python(
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
log.step("Installing build tools...")
|
||||
|
||||
call(
|
||||
["python", "-m", "pip", "install", "--upgrade", "pip", *dependency_constraint_flags],
|
||||
env=env,
|
||||
|
||||
Reference in New Issue
Block a user