From f9910399d5cab82aacf7086abad9e0fea86bd355 Mon Sep 17 00:00:00 2001 From: Albert Wu Date: Fri, 23 Nov 2018 09:33:58 -0800 Subject: [PATCH 1/4] use curr python interp. in subprocess --- spinup/utils/run_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spinup/utils/run_utils.py b/spinup/utils/run_utils.py index e1d7b56c9..4da7e4ee4 100644 --- a/spinup/utils/run_utils.py +++ b/spinup/utils/run_utils.py @@ -166,7 +166,7 @@ def thunk_plus(): encoded_thunk = base64.b64encode(zlib.compress(pickled_thunk)).decode('utf-8') entrypoint = osp.join(osp.abspath(osp.dirname(__file__)),'run_entrypoint.py') - cmd = ['python', entrypoint, encoded_thunk] + cmd = [sys.executable, entrypoint, encoded_thunk] try: subprocess.check_call(cmd, env=os.environ) except CalledProcessError: @@ -554,4 +554,4 @@ def test_eg(): eg.add('why', [True,False]) eg.add('huh', 5) eg.add('no', 6, in_name=True) - return eg.variants() \ No newline at end of file + return eg.variants() From 8aa603723ee5009ed39b9c71c23698593d2445e0 Mon Sep 17 00:00:00 2001 From: Albert Wu Date: Fri, 23 Nov 2018 09:51:50 -0800 Subject: [PATCH 2/4] check if sys.executable is valid --- spinup/utils/run_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spinup/utils/run_utils.py b/spinup/utils/run_utils.py index 4da7e4ee4..32f3ade6a 100644 --- a/spinup/utils/run_utils.py +++ b/spinup/utils/run_utils.py @@ -166,7 +166,7 @@ def thunk_plus(): encoded_thunk = base64.b64encode(zlib.compress(pickled_thunk)).decode('utf-8') entrypoint = osp.join(osp.abspath(osp.dirname(__file__)),'run_entrypoint.py') - cmd = [sys.executable, entrypoint, encoded_thunk] + cmd = [sys.executable if sys.executable else 'python', entrypoint, encoded_thunk] try: subprocess.check_call(cmd, env=os.environ) except CalledProcessError: From ef1ec71452579f81da2be7788fad5df2767e872a Mon Sep 17 00:00:00 2001 From: Albert Wu Date: Fri, 23 Nov 2018 10:49:32 -0800 Subject: [PATCH 3/4] use curr python interp. in subprocess --- spinup/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spinup/run.py b/spinup/run.py index 60ea25dd4..0482cb506 100644 --- a/spinup/run.py +++ b/spinup/run.py @@ -221,7 +221,7 @@ def process(arg): elif cmd in valid_utils: # Execute the correct utility file. runfile = osp.join(osp.abspath(osp.dirname(__file__)), 'utils', cmd +'.py') - args = ['python', runfile] + sys.argv[2:] + args = [sys.executable if sys.executable else 'python', runfile] + sys.argv[2:] subprocess.check_call(args, env=os.environ) else: # Assume that the user plans to execute an algorithm. Run custom From 85c9931b67d15d29b0afedb6ddd8c8aa722f3419 Mon Sep 17 00:00:00 2001 From: Albert Wu Date: Fri, 23 Nov 2018 13:03:46 -0800 Subject: [PATCH 4/4] version bump to 0.1.2 --- spinup/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spinup/version.py b/spinup/version.py index 84f86a447..0eca826f6 100644 --- a/spinup/version.py +++ b/spinup/version.py @@ -1,4 +1,4 @@ -version_info = (0, 1, 1) +version_info = (0, 1, 2) # format: # ('spinup_major', 'spinup_minor', 'spinup_patch')