From 5ad920b3fab2ddf1c5fe5aa3a73e014addab9a74 Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Fri, 23 Dec 2022 15:04:06 -0700 Subject: [PATCH] add MET_BASE/python to python path for global python environment (used when MET_PYTHON_EXE is not set) so Python Embedding point obs scripts can find met_point_obs without setting PYTHONPATH --- src/libcode/vx_python3_utils/global_python.h | 3 +++ src/libcode/vx_python3_utils/python3_util.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/libcode/vx_python3_utils/global_python.h b/src/libcode/vx_python3_utils/global_python.h index ac796d5187..8674a7b655 100644 --- a/src/libcode/vx_python3_utils/global_python.h +++ b/src/libcode/vx_python3_utils/global_python.h @@ -75,6 +75,9 @@ if ( ! is_initialized ) { command << cs_erase << "sys.path.append(\"" << replace_path(wrappers_dir) + << "\");" + << "sys.path.append(\"" + << replace_path(python_dir) << "\")"; run_python_string(command.text()); diff --git a/src/libcode/vx_python3_utils/python3_util.h b/src/libcode/vx_python3_utils/python3_util.h index b1681463c0..9464142566 100644 --- a/src/libcode/vx_python3_utils/python3_util.h +++ b/src/libcode/vx_python3_utils/python3_util.h @@ -30,6 +30,8 @@ static const char user_python_path_env [] = "MET_PYTHON_EXE"; static const char wrappers_dir [] = "MET_BASE/wrappers"; +static const char python_dir [] = "MET_BASE/python"; + ////////////////////////////////////////////////////////////////////////