diff --git a/include/eigenpy/details.hpp b/include/eigenpy/details.hpp
index 22110af0cdc639cbb1a88ab049c84ebe4c10e508..33501dbd1cc4023885c93cae8c909c3126c7dbdc 100644
--- a/include/eigenpy/details.hpp
+++ b/include/eigenpy/details.hpp
@@ -573,7 +573,6 @@ namespace eigenpy
   };
 #endif
 
-#define numpy_import_array() {if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); } }
   
   template<typename MatType,typename EigenEquivalentType>
   EIGENPY_DEPRECATED
diff --git a/include/eigenpy/numpy-type.hpp b/include/eigenpy/numpy-type.hpp
index 07be4c99a252a54373c31207d33387d0b39511aa..557276b70ef15f71c3a25c7c632fee6f3373aa0c 100644
--- a/include/eigenpy/numpy-type.hpp
+++ b/include/eigenpy/numpy-type.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 2018-2020, INRIA
+ * Copyright 2018-2020 INRIA
 */
 
 #ifndef __eigenpy_numpy_type_hpp__
@@ -102,9 +102,11 @@ namespace eigenpy
     }
 
   protected:
+    
     NumpyType()
     {
       pyModule = bp::import("numpy");
+      
 #if PY_MAJOR_VERSION >= 3
       // TODO I don't know why this Py_INCREF is necessary.
       // Without it, the destructor of NumpyType SEGV sometimes.
@@ -132,7 +134,45 @@ namespace eigenpy
 
     NP_TYPE np_type;
   };
+
+  namespace details
+  {
+    struct import_numpy
+    {
     
+      static bool status()
+      {
+        return instance().imported;
+      }
+      
+    protected:
+      
+      static import_numpy & instance()
+      {
+        static import_numpy m_instance;
+        return m_instance;
+      }
+      
+      import_numpy()
+      : imported(false)
+      {
+        if(_import_array() < 0)
+        {
+          PyErr_Print();
+          PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import");
+        }
+        else
+          imported = true;
+      }
+      
+      bool imported;
+    };
+  } //  namespace details
+    
+  inline bool numpy_import_array()
+  {
+    return details::import_numpy::status();
+  }
 }
 
 #endif // ifndef __eigenpy_numpy_type_hpp__