diff --git a/libtbx/auto_build/bootstrap.py b/libtbx/auto_build/bootstrap.py index 0d04552c88..75add5dcea 100644 --- a/libtbx/auto_build/bootstrap.py +++ b/libtbx/auto_build/bootstrap.py @@ -1671,6 +1671,8 @@ def m_get_conda_python(self): elif self.isPlatformMacOSX(): m_conda_python = os.path.join('python.app', 'Contents', 'MacOS', 'python') + if not os.path.isfile(m_conda_python): + m_conda_python = os.path.join('bin', 'python') return m_conda_python # ----------------------------------------------------------------------- diff --git a/libtbx/auto_build/conda_build/update_libtbx_env.py b/libtbx/auto_build/conda_build/update_libtbx_env.py index e3467f9d5d..2cbb708641 100644 --- a/libtbx/auto_build/conda_build/update_libtbx_env.py +++ b/libtbx/auto_build/conda_build/update_libtbx_env.py @@ -120,7 +120,9 @@ def update_libtbx_env(default_dir=None): env.pythonpath = list() sys_executable = sys.executable if sys.platform == 'darwin' and 'python.app' not in sys_executable: - sys_executable = os.path.join(sys_prefix, 'python.app', 'Contents', 'MacOS', 'python') + new_executable = os.path.join(sys_prefix, 'python.app', 'Contents', 'MacOS', 'python') + if os.path.isfile(new_executable): + sys_executable = new_executable env.python_exe = env.as_relocatable_path(sys_executable) env.no_bin_python = True site_packages_path = None diff --git a/libtbx/auto_build/install_conda.py b/libtbx/auto_build/install_conda.py index 07e7b5faec..de2d4616c2 100644 --- a/libtbx/auto_build/install_conda.py +++ b/libtbx/auto_build/install_conda.py @@ -438,6 +438,8 @@ def get_conda_python(self, conda_env=None, check_file=None): # use python.app for GUI applications conda_python = os.path.join(conda_env, 'python.app', 'Contents', 'MacOS', 'python') + if not os.path.isfile(conda_python): + conda_python = os.path.join(conda_env, 'bin', 'python') else: conda_python = os.path.join(conda_env, 'bin', 'python') diff --git a/libtbx/auto_build/install_distribution.py b/libtbx/auto_build/install_distribution.py index 717de9df4a..e3fa8a0cca 100644 --- a/libtbx/auto_build/install_distribution.py +++ b/libtbx/auto_build/install_distribution.py @@ -402,6 +402,8 @@ def reconfigure(self, log): if 'darwin' in sys.platform: base_python = os.path.join(self.base_dir, 'python.app', 'Contents', 'MacOS', 'python') + if not os.path.isfile(base_python): + base_python = os.path.join(self.base_dir, 'bin', 'python') elif 'win32' in sys.platform: base_python = os.path.join(self.base_dir, 'python.exe')