From 30c5a0e4b30f15ad5f4f97f640bc9dbf710214ef Mon Sep 17 00:00:00 2001 From: Wouter Hardeman Date: Sun, 7 Jan 2018 21:30:47 +0100 Subject: [PATCH] Fixed issue with unity environment not being found on MacOS If the internal executable can't be found, it will look for any file in the folder and run it. --- python/unityagents/environment.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/unityagents/environment.py b/python/unityagents/environment.py index d1802020ca..8991b9d1ab 100755 --- a/python/unityagents/environment.py +++ b/python/unityagents/environment.py @@ -73,6 +73,10 @@ def __init__(self, file_name, worker_id=0, candidates = glob.glob(os.path.join(cwd, file_name + '.app', 'Contents', 'MacOS', true_filename)) if len(candidates) == 0: candidates = glob.glob(os.path.join(file_name + '.app', 'Contents', 'MacOS', true_filename)) + if len(candidates) == 0: + candidates = glob.glob(os.path.join(cwd, file_name + '.app', 'Contents', 'MacOS', '*')) + if len(candidates) == 0: + candidates = glob.glob(os.path.join(file_name + '.app', 'Contents', 'MacOS', '*')) if len(candidates) > 0: launch_string = candidates[0] elif platform == 'win32':