diff options
Diffstat (limited to 'coin_build_instructions.py')
-rw-r--r-- | coin_build_instructions.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/coin_build_instructions.py b/coin_build_instructions.py index f3f8d2016..4f006612f 100644 --- a/coin_build_instructions.py +++ b/coin_build_instructions.py @@ -113,7 +113,17 @@ def call_setup(python_ver, phase): rmtree(_env, True) # Pinning the virtualenv before creating one run_instruction(["pip", "install", "--user", "virtualenv==20.0.25"], "Failed to pin virtualenv") - run_instruction(["virtualenv", "-p", _pExe, _env], "Failed to create virtualenv") + # installing to user base might not be in PATH by default. + env_path = os.path.join(site.USER_BASE, "bin") + v_env = os.path.join(env_path, "virtualenv") + if sys.platform == "win32": + env_path = os.path.join(site.USER_BASE, "Scripts") + v_env = os.path.join(env_path, "virtualenv.exe") + try: + run_instruction([v_env, "--version"], "Using default virtualenv") + except Exception as e: + v_env = "virtualenv" + run_instruction([v_env, "-p", _pExe, _env], "Failed to create virtualenv") # When the 'python_ver' variable is empty, we are using Python 2 # Pip is always upgraded when CI template is provisioned, upgrading it in later phase may cause perm issue run_instruction([env_pip, "install", "-r", "requirements.txt"], "Failed to install dependencies") |