Closed MarStarck closed 6 years ago
you have to modify python binding to support python3 https://github.com/MichalBusta/FASText/blob/master/src/Python/pyFastTextAPIG.c
replace PyMODINIT_FUNC initftext(void) { PyObject *m;
m = Py_InitModule("ftext", FastTextMethods);
import_array();
if (m == NULL)
return;
FastTextError = PyErr_NewException((char*) "ftext.error", NULL, NULL);
Py_INCREF(FastTextError);
PyModule_AddObject(m, "error", FastTextError);
}
with something like:
static struct PyModuleDef spammodule = { PyModuleDef_HEAD_INIT, "ftext", / name of module / NULL, / module documentation, may be NULL / -1, / size of per-interpreter state of the module, or -1 if the module keeps state in global variables. / FastTextMethods };
PyMODINIT_FUNC PyInit_ftext(void) { return PyModule_Create(&spammodule); }
I compiled successfully but it says
ImportError: dynamic module does not define module export function (PyInit_ftext)