From c0b621605f4f081ea4096308b618ca9d4846fa53 Mon Sep 17 00:00:00 2001 From: Robert Bartel Date: Wed, 6 Mar 2024 17:38:26 -0500 Subject: [PATCH] Update Python interpreter system path order on MacOS. --- include/utilities/python/InterpreterUtil.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/utilities/python/InterpreterUtil.hpp b/include/utilities/python/InterpreterUtil.hpp index b3f6cc764b..de4c0a6dd4 100644 --- a/include/utilities/python/InterpreterUtil.hpp +++ b/include/utilities/python/InterpreterUtil.hpp @@ -146,7 +146,11 @@ namespace utils { py::object requestedDirPath = Path(directoryPath); if (py::bool_(requestedDirPath.attr("is_dir")())) { if (std::find(sys_path_vector.begin(), sys_path_vector.end(), directoryPath) == sys_path_vector.end()) { +#ifdef __APPLE__ + sys_path.attr("insert")(1, py::str(directoryPath)); +#else sys_path.attr("insert")(sys_path_vector.size(), py::str(directoryPath)); +#endif } } else {