XSLT存档  

不及格的程序员-八神

 查看分类:  ASP.NET XML/XSLT JavaScripT   我的MSN空间Blog

RuntimeError: CPU dispatcher tracer already initlized

#define PY_SSIZE_T_CLEAN
#include <Python.h>

// clang bug.c `python3-config --embed --cflags` `python3-config --embed --ldflags`

void import_numpy() {
  Py_Initialize();
  PyObject* numpy = PyImport_ImportModule("numpy");
  if (!numpy) {
    PyErr_Print();
  }
  Py_CLEAR(numpy);
  Py_Finalize();
}

int main() {
  import_numpy(); // this works
  import_numpy(); // this hits the exception
  return 0;
}
ngoldbaum Member
Numpy doesn't support module reloading. We'd need to convert all of the NumPy C extensions to use multi-phase initialization to fix this, as I understand it.

 

posted on 2025-05-28 13:43  不及格的程序员-八神  阅读(244)  评论(0)    收藏  举报