После обновления pyconfig-64.h в python-dev включите, как показано ниже:
/* Define as the size of the unicode type. */
//#define Py_UNICODE_SIZE 4
#define Py_UNICODE_SIZE 2
Я обнаружил, что unicodeobject.h:
/* FIXME: MvL's new implementation assumes that Py_UNICODE_SIZE is
properly set, but the default rules below doesn't set it. I'll
sort this out some other day -- fredrik@pythonware.com */
После выравнивания этих файлов в python-dev для отражения UCS2, перекомпиляции python для UCS2 и обновления около 17 различных файлов .c в statsmodels, например:
// #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4) (PyUnicode_AS_UNICODE(u)[i]))
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS2)(PyUnicode_AS_UNICODE(u)[i]))
Мне наконец-то удалось успешно импортировать statsmodels и numpy.
Я думаю, это нужно исправить в python, а также в statsmodels.