From 14655f19a0ddc48fdd53210d2e2252bd519f2530 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Thu, 15 Oct 2020 23:26:58 +0300 Subject: [PATCH] Fix conda PYTHONPATH (point only to code, not to venv) --- trains_agent/helper/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trains_agent/helper/base.py b/trains_agent/helper/base.py index 4be2ff1..a3682c9 100644 --- a/trains_agent/helper/base.py +++ b/trains_agent/helper/base.py @@ -197,7 +197,8 @@ def safe_remove_tree(filename): pass -def get_python_path(script_dir, entry_point, package_api): +def get_python_path(script_dir, entry_point, package_api, is_conda_env=False): + # noinspection PyBroadException try: python_path_sep = ';' if is_windows_platform() else ':' python_path_cmd = package_api.get_python_command( @@ -211,7 +212,7 @@ def get_python_path(script_dir, entry_point, package_api): if is_windows_platform(): return python_path.replace('/', '\\') + org_python_path - return python_path + org_python_path + return python_path if is_conda_env else (python_path + org_python_path) except Exception: return None