fix [#26951] blenderplayer and runtimes will not load
[blender-staging.git] / source / gameengine / Ketsji / KX_PythonInit.cpp
index ba698d79fdd694d98d6b43317f5cf7b0cacabf63..a3738995db37f50bb05c0c5d80012a12c34b5bb8 100644 (file)
@@ -1758,6 +1758,7 @@ static struct _inittab bge_internal_modules[]= {
 
 /**
  * Python is not initialised.
+ * see bpy_interface.c's BPY_python_start() which shares the same functionality in blender.
  */
 PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level, Main *maggie, int argc, char** argv)
 {
@@ -1779,6 +1780,9 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur
        /* must run before python initializes */
        PyImport_ExtendInittab(bge_internal_modules);
 
+       /* find local python installation */
+       PyC_SetHomePath(BLI_get_folder(BLENDER_PYTHON, NULL));
+
        Py_Initialize();
        
        if(argv && first_time) { /* browser plugins dont currently set this */