creating numpy array in c extension segfaults
问题 I'm just trying to start off by creating a numpy array before I even start to write my extension. Here is a super simple program: #include <stdio.h> #include <iostream> #include "Python.h" #include "numpy/npy_common.h" #include "numpy/ndarrayobject.h" #include "numpy/arrayobject.h" int main(int argc, char * argv[]) { int n = 2; int nd = 1; npy_intp size = {1}; PyObject* alpha = PyArray_SimpleNew(nd, &size, NPY_DOUBLE); return 0; } This program segfaults on the PyArray_SimpleNew call and I don