From 58caa79b9d3f9dcccb857a3578c8ab04aa19b92c Mon Sep 17 00:00:00 2001 From: Ryan Field Date: Fri, 5 Aug 2022 15:03:08 +0100 Subject: [PATCH] Fix Registry install on windows --- fair/virtualenv.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fair/virtualenv.py b/fair/virtualenv.py index 25b4433..59416db 100644 --- a/fair/virtualenv.py +++ b/fair/virtualenv.py @@ -14,6 +14,7 @@ import logging import os import shutil +import sys from types import SimpleNamespace from venv import EnvBuilder @@ -32,12 +33,9 @@ def __init__(self, *args, **kwargs) -> None: def ensure_directories(self, env_dir) -> SimpleNamespace: self._logger.debug(f"Creating virtual environment in '{env_dir}'") _context: SimpleNamespace = super().ensure_directories(env_dir) - _python_exe = shutil.which("python3") + _python_exe = sys.executable if not _python_exe: - self._logger.warning("python3.exe not found trying python.exe") - _python_exe = shutil.which("python") - if not _python_exe: - raise PythonExecutableIdentificationError + raise PythonExecutableIdentificationError self._logger.debug(f"Using python '{_python_exe}' for setup")