Python - C embedded Segmentation fault
I am facing a problem similar to the Py_initialize / Py_Finalize not working twice with numpy .. The basic coding in C: Py_Initialize(); import_array(); //Call a python function which imports numpy as a module //Py_Finalize() The program is in a loop and it gives a seg fault if the python code has numpy as one of the imported module. If I remove numpy, it works fine. As a temporary work around I tried not to use Py_Finalize(), but that is causing huge memory leaks [ observed as the memory usage from TOP keeps on increasing ]. And I tried but did not understand the suggestion in that link I