From 004b96ec21c0b7e466562be82c567a67744e296d 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 3dab01df39..16d3766c24 100644 --- a/scripting/python_scripting.cpp +++ b/scripting/python_scripting.cpp @@ -289,6 +289,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