From 33419dcfcb0d5a2378330e3dfd7e2463fd8489b9 Mon Sep 17 00:00:00 2001 From: Neta Zmora <neta.zmora@intel.com> Date: Wed, 19 Jun 2019 18:51:02 +0300 Subject: [PATCH] Add the value of PYTHONPATH to the log When we use alternative implementations of the libraries in our requirements.txt, we need to set PYTHONPATH to point to these libraries. Because this affects our ability to reproduce experiments later, the least we can do is log where PYTHONPATH is pointing to. --- distiller/apputils/execution_env.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/distiller/apputils/execution_env.py b/distiller/apputils/execution_env.py index 09b6d49..ee8a73f 100755 --- a/distiller/apputils/execution_env.py +++ b/distiller/apputils/execution_env.py @@ -85,6 +85,10 @@ def log_execution_env_state(config_paths=None, logdir=None, gitroot='.'): if HAVE_LSB: logger.debug("OS: %s", lsb_release.get_lsb_information()['DESCRIPTION']) logger.debug("Python: %s", sys.version) + try: + logger.debug("PYTHONPATH: %s", os.environ['PYTHONPATH']) + except KeyError: + pass def _pip_freeze(): return {x.key:x.version for x in sorted(pkg_resources.working_set, key=operator.attrgetter('key'))} -- GitLab