diff --git a/modules/mol/base/pymod/export_entity.cc b/modules/mol/base/pymod/export_entity.cc
index 35b918b16231a4d6842ca382ca96bbbebee7aa8c..62d26b5b5c4a4156b6adf364a10f4468e09988f2 100644
--- a/modules/mol/base/pymod/export_entity.cc
+++ b/modules/mol/base/pymod/export_entity.cc
@@ -35,7 +35,15 @@ using namespace ost::mol;
 
 #include <ost/export_helper/generic_property_def.hh>
 
+/* Including NumPy headers produces compiler warnings. The ones about "Using
+   deprecated NumPy API..." we can not get rid of. The highest NumPy version we
+   support is 1.6 while the non-deprecated API starts with version 1.7.
+   Also see the comment in modules/gfx/pymod/export_primlist.cc for further
+   information.
+*/
 #if OST_NUMPY_SUPPORT_ENABLED
+#include <numpy/numpyconfig.h>
+#define NPY_NO_DEPRECATED_API NPY_1_6_API_VERSION
 #include <numpy/arrayobject.h>
 #endif
 
@@ -131,6 +139,7 @@ void export_Entity()
 {
 #if OST_NUMPY_SUPPORT_ENABLED
   // The following define enforces no return value when calling import_array
+  #undef NUMPY_IMPORT_ARRAY_RETVAL
   #define NUMPY_IMPORT_ARRAY_RETVAL
   import_array();
 #endif