diff --git a/CMakeLists.txt b/CMakeLists.txt
index 38dc81c6..6271a08a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -72,6 +72,9 @@ add_subdirectory( pykig )
 if(BoostPython_FOUND)
   add_subdirectory( scripting )
   add_definitions(-DKIG_ENABLE_PYTHON_SCRIPTING)
+  get_filename_component(PYTHON_LIBRARY_REALPATH "${PYTHON_LIBRARY}" REALPATH)
+  get_filename_component(LIB_PYTHON ${PYTHON_LIBRARY_REALPATH} NAME)
+  add_definitions(-DLIB_PYTHON="${LIB_PYTHON}")
 endif(BoostPython_FOUND)
 
 set_package_properties(
diff --git a/scripting/python_scripter.cc b/scripting/python_scripter.cc
index 35c4dc4d..d105fb41 100644
--- a/scripting/python_scripter.cc
+++ b/scripting/python_scripter.cc
@@ -10,6 +10,8 @@
 #include "python_scripter.h"
 #include <Python.h>
 
+#include <QLibrary>
+
 #include <iostream>
 #include <string>
 
@@ -309,6 +311,11 @@ PythonInitializer::PythonInitializer()
 {
     // tell the python interpreter about our API..
 
+    QLibrary *pythonLib = new QLibrary();
+    pythonLib->setLoadHints(QLibrary::ExportExternalSymbolsHint);
+    pythonLib->setFileName(LIB_PYTHON);
+    pythonLib->load();
+
     PyImport_AppendInittab("kig", PyInit_kig);
 
     Py_Initialize();
