diff --git a/pex/bin/pex.py b/pex/bin/pex.py index 5dbd60ee9..51d84966d 100755 --- a/pex/bin/pex.py +++ b/pex/bin/pex.py @@ -19,6 +19,7 @@ from pex.base import maybe_requirement from pex.common import die, safe_delete, safe_mkdir, safe_mkdtemp from pex.crawler import Crawler +from pex.executor import Executor from pex.fetcher import Fetcher, PyPIFetcher from pex.http import Context from pex.installer import EggInstaller @@ -534,7 +535,12 @@ def build_pex(args, options, resolver_option_builder): # NB: options.python and interpreter constraints cannot be used together, so this will not # affect usages of the interpreter(s) specified by the "--python" command line flag if ENV.PEX_PYTHON_PATH: - interpreters = PythonInterpreter.all(str(ENV.PEX_PYTHON_PATH).split(os.pathsep)) + interpreters = [] + for binary in ENV.PEX_PYTHON_PATH.split(os.pathsep): + try: + interpreters.append(PythonInterpreter.from_binary(binary)) + except Executor.ExecutionError: + pass else: interpreters = PythonInterpreter.all() constraints = options.interpreter_constraint