Py_initialize / Py_Finalize not working twice with numpy

前端 未结 2 953
轮回少年
轮回少年 2020-11-29 11:14

On the second call of the following code, my app segfault, so I guess I am missing something :

Py_Initialize();
pName = PyString_FromString(\"comp_macbeth\")         


        
2条回答
  •  孤独总比滥情好
    2020-11-29 11:33

    I have this in my module initialization part, but the URL does not exist anymore. In case it helps:

    // http://numpy.scipy.org/numpydoc/numpy-13.html mentions this must be done in module init, otherwise we will crash
    import_array();
    

提交回复
热议问题