From df04e4e1ca5841296ff8540903e323b0fef31740 Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Thu, 29 Nov 2018 20:18:28 -0800 Subject: [PATCH] Fix tools/provision on OS X. See the comment for details. --- tools/provision | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/provision b/tools/provision index 2269e8f..81754c7 100755 --- a/tools/provision +++ b/tools/provision @@ -76,8 +76,15 @@ the Python version this command is executed with.""" # `import_module`. activate_module_dir = os.path.abspath(os.path.join(venv_dir, venv_exec_dir)) sys.path.append(activate_module_dir) + import_module('activate_this') + # On OS X, ensure we use the virtualenv version of the python binary for + # future subprocesses instead of the version that this script was launched with. See + # https://stackoverflow.com/questions/26323852/whats-the-meaning-of-pyvenv-launcher-environment-variable + if '__PYVENV_LAUNCHER__' in os.environ: + del os.environ['__PYVENV_LAUNCHER__'] + # In order to install all required packages for the venv, `pip` needs to be executed by # the venv's Python interpreter. `--prefix venv_dir` ensures that all modules are installed # in the right place.