ImportError: /root/generator/exporters.so: undefined symbol: PyModule_Create2
我添加的代码如下:
#ifdef PY3K
static struct PyModuleDef exporters =
{
PyModuleDef_HEAD_INIT,
"exporters", /* name of module */
"", /* module documentation, may be NULL */
-1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */
exporters_methods
};
/*
* Python calls this to let us initialize our module
*/
void PyInit_exporters() {
(void) PyModule_Create(&exporters);
}
#else
/*
* Python calls this to let us initialize our module
*/
void initexporters() {
(void) Py_InitModule("exporters", exporters_methods);
}
#endif
该代码适用于使用python2构建的模块,但不适用于python3。 我曾尝试查看是否正在使用调试版本进行构建,如许多答案中所述,但未能做到这一点。 请帮忙
目前没有回答
相关问题 更多 >
编程相关推荐