From ff950773759423085f506ced0cc8f0f77afff5d1 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 26 Jan 2019 17:05:25 -0500 Subject: Fix pip upgrade/downgrade on Windows. --- pip-wrapper.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pip-wrapper.py b/pip-wrapper.py index 5cb59640..30a56fd5 100644 --- a/pip-wrapper.py +++ b/pip-wrapper.py @@ -12,7 +12,13 @@ import subprocess def ensure_pip_version(pip_bin, ver): - cmd = [pip_bin, 'install', 'pip ' + ver] + """ + Ensure the pip version meets the specified version. + + Use python -m pip to upgrade/downgrade, because for this operation, + on Windows, pip.exe must not be locked. + """ + cmd = [sys.executable, '-m', 'pip', 'install', 'pip ' + ver] subprocess.check_call(cmd) -- cgit v1.2.1