Python C-API and Numpy: core dump on import_array
Question: 
    //testNumpy.c
    #include<Python.h>
    #include<numpy/arrayobject.h>
    #include<stdio.h>
    int main(){
        printf("import_array\n");fflush(stdout);
        import_array();
        printf("import_array done\n");fflush(stdout);
    }
    
    $ gcc -I/usr/include/python2.6 -lpython2.6 testNumpy.c&&./a.out
    import_array
    Segmentation fault (core dumped)
    

What could I possibly be doing wrong on such a simple program? I'm tearing my
hair out :-)


Answer: For starters, you did not initialize Python properly. Call
[Py_Initialize()](http://docs.python.org/c-api/init.html) before trying to
initialize NumPy.

