provision: Make sure the correct version of pip is installed.
pip 8.0+ is required to successfully run the script (otherwise, the prefix
option doesn't work). pip 9.0+ is installed because of the safety features.
@@ -57,8 +57,11 @@ the Python version this command is executed with."""
# the venv's Python interpreter. `--prefix venv_dir` ensures that all modules are installed
# in the right place.
def install_dependencies(requirements_filename):
- if subprocess.call([os.path.join(venv_dir, venv_exec_dir, 'pip'),
- 'install', '--prefix', venv_dir, '-r', os.path.join(base_dir, requirements_filename)]):
+ pip_path = os.path.join(venv_dir, venv_exec_dir, 'pip')
+ # We first install a modern version of pip that supports --prefix
+ subprocess.call([pip_path, 'install', 'pip>=9.0'])
+ if subprocess.call([pip_path, 'install', '--prefix', venv_dir, '-r',
+ os.path.join(base_dir, requirements_filename)]):
raise OSError("The command `pip install -r {}` failed. Dependencies not installed!"
.format(os.path.join(base_dir, requirements_filename)))
