From 34a51d3c21a343e4c2cc500f42027d7c79ca85e8 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Tue, 14 Nov 2023 07:14:13 -0500 Subject: [PATCH] Make wxPython work under run from build directory on macOS --- scripting/python_scripting.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripting/python_scripting.cpp b/scripting/python_scripting.cpp index 4d0e38065c..93c293c3fa 100644 --- a/scripting/python_scripting.cpp +++ b/scripting/python_scripting.cpp @@ -296,6 +296,11 @@ bool SCRIPTING::scriptingSetup() pyhome += Pgm().GetExecutablePath() + wxT( "Contents/Frameworks/Python.framework/Versions/Current" ); + if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) ) + { + pyhome = wxString( wxT( PYTHON_SITE_PACKAGE_PATH ) ) + wxT( "/../../../" ); + } + // set $PYTHONHOME wxSetEnv( wxT( "PYTHONHOME" ), pyhome ); #else