diff --git a/src/rez_pip/rez.py b/src/rez_pip/rez.py index 430f355..f2ab41c 100644 --- a/src/rez_pip/rez.py +++ b/src/rez_pip/rez.py @@ -250,8 +250,11 @@ def getPythonExecutables( [f"{package.name}=={package.version}"] ) + # Make sure that system PATH doens't interfere with the "which" method. + resolvedContext.append_sys_path = False + for trimmedVersion in map(package.version.trim, [2, 1, 0]): - path = resolvedContext.which(f"python{trimmedVersion}") + path = resolvedContext.which(f"python{trimmedVersion}", parent_environ={}) if path: pythons[str(package.version)] = path break