From fc3b2dc1e27d667b863cbf8d82d7116d474573b3 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Wed, 10 Nov 2021 14:26:24 -0600 Subject: [PATCH] minor --- modules/util/setup.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/util/setup.py b/modules/util/setup.py index 5b1f173a..32a67b22 100644 --- a/modules/util/setup.py +++ b/modules/util/setup.py @@ -1,7 +1,7 @@ # To support both python 2 and python 3 from __future__ import division, print_function, unicode_literals -import os +import os, sys from pathlib import Path @@ -29,12 +29,20 @@ cachepath = cachepath+'.pkl' try: user_paths = os.environ['PYTHONPATH'].split(os.pathsep) - python_path = user_paths[0] + os.sep + python_path = None + if len(user_paths) > 1: + for up in user_paths: + if up.find('cimss_icing') > 0: + python_path = up + os.sep + else: + python_path = user_paths[0] + os.sep + if python_path is None: + print('** No PYTHONPATH found containing cimss_icing/model *', file=sys.stderr) ancillary_path = python_path + 'ancillary' + os.sep model_path_day = python_path + 'tf_model_day' + os.sep model_path_night = python_path + 'tf_model_night' + os.sep except KeyError: - print('** PYTHONPATH must be defined! *') + print('** PYTHONPATH must be defined! *', file=sys.stderr) python_path = None gpu_devices = {0: '/device:GPU:0', 1: '/device:GPU:1', 2: '/device:GPU:2'} -- GitLab