diff --git a/easybuild/easyblocks/e/easybuildmeta.py b/easybuild/easyblocks/e/easybuildmeta.py index 96131f7950b..f083426ec90 100644 --- a/easybuild/easyblocks/e/easybuildmeta.py +++ b/easybuild/easyblocks/e/easybuildmeta.py @@ -30,6 +30,7 @@ import copy import os import re +import sys from distutils.version import LooseVersion from easybuild.easyblocks.generic.pythonpackage import PythonPackage @@ -65,6 +66,17 @@ def __init__(self, *args, **kwargs): # consider setuptools first, in case it is listed as a sources self.easybuild_pkgs.insert(0, 'setuptools') + # Override this function since we want to respect the user choice for the python installation to use + # (which can be influenced by EB_PYTHON and EB_INSTALLPYTHON) + def prepare_python(self): + """Python-specific preparations.""" + + self.python_cmd = sys.executable + # set Python lib directories + self.set_pylibdirs() + + self.log.info("Python command being used: %s", self.python_cmd) + def check_readiness_step(self): """Make sure EasyBuild can be installed with a loaded EasyBuild module.""" env_var_name = get_software_root_env_var_name(self.name) diff --git a/easybuild/easyblocks/generic/pythonpackage.py b/easybuild/easyblocks/generic/pythonpackage.py index 973a7410856..6211e038dd9 100644 --- a/easybuild/easyblocks/generic/pythonpackage.py +++ b/easybuild/easyblocks/generic/pythonpackage.py @@ -370,7 +370,7 @@ def set_pylibdirs(self): self.pylibdir = self.all_pylibdirs[0] def prepare_python(self): - """Python-specific preperations.""" + """Python-specific preparations.""" # pick 'python' command to use python = None