Skip to content

Commit

Permalink
Merge pull request #257 from FAIRDataPipeline/hotfix/python-exec-fix
Browse files Browse the repository at this point in the history
Fix Registry install on windows
  • Loading branch information
RyanJField committed Aug 11, 2022
2 parents cbaadf1 + 58caa79 commit 93e378c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions fair/virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import logging
import os
import shutil
import sys
from types import SimpleNamespace
from venv import EnvBuilder

Expand All @@ -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")

Expand Down

0 comments on commit 93e378c

Please sign in to comment.