Python3.7 mlpy 安装错误 - 'PyThreadState {aka struct _ts}' 没有名为 'exc_type' 的成员

Python3.7 mlpy installation error - 'PyThreadState {aka struct _ts}' has no member named 'exc_type'

尝试在 macOS Catalina 的虚拟环境中安装 mlpy 3.5.0,出现错误。

In file included from /Users/martin/.virtualenvs/BA/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1832:0,
                 from /Users/martin/.virtualenvs/BA/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /Users/martin/.virtualenvs/BA/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from mlpy/gsl/gsl.c:227:
/Users/martin/.virtualenvs/BA/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it with " \
  ^
mlpy/gsl/gsl.c: In function '__pyx_pf_4mlpy_3gsl_2stats_quantile_from_sorted_data':
mlpy/gsl/gsl.c:921:14: warning: variable '__pyx_bshape_0_sorted_data_arr' set but not used [-Wunused-but-set-variable]
   Py_ssize_t __pyx_bshape_0_sorted_data_arr = 0;
              ^
mlpy/gsl/gsl.c:920:14: warning: variable '__pyx_bstride_0_sorted_data_arr' set but not used [-Wunused-but-set-variable]
   Py_ssize_t __pyx_bstride_0_sorted_data_arr = 0;
              ^
mlpy/gsl/gsl.c: In function '__Pyx_GetException':
mlpy/gsl/gsl.c:4027:22: error: 'PyThreadState {aka struct _ts}' has no member named 'exc_type'
     tmp_type = tstate->exc_type;
                      ^
mlpy/gsl/gsl.c:4028:23: error: 'PyThreadState {aka struct _ts}' has no member named 'exc_value'
     tmp_value = tstate->exc_value;
                       ^
mlpy/gsl/gsl.c:4029:20: error: 'PyThreadState {aka struct _ts}' has no member named 'exc_traceback'
     tmp_tb = tstate->exc_traceback;
                    ^
mlpy/gsl/gsl.c:4030:11: error: 'PyThreadState {aka struct _ts}' has no member named 'exc_type'
     tstate->exc_type = local_type;
           ^
mlpy/gsl/gsl.c:4031:11: error: 'PyThreadState {aka struct _ts}' has no member named 'exc_value'
     tstate->exc_value = local_value;
           ^
mlpy/gsl/gsl.c:4032:11: error: 'PyThreadState {aka struct _ts}' has no member named 'exc_traceback'
     tstate->exc_traceback = local_tb;
           ^
mlpy/gsl/gsl.c: In function '__Pyx_ExceptionSave':
mlpy/gsl/gsl.c:4222:19: error: 'PyThreadState {aka struct _ts}' has no member named 'exc_type'
     *type = tstate->exc_type;
                   ^
mlpy/gsl/gsl.c:4223:20: error: 'PyThreadState {aka struct _ts}' has no member named 'exc_value'
     *value = tstate->exc_value;
                    ^
mlpy/gsl/gsl.c:4224:17: error: 'PyThreadState {aka struct _ts}' has no member named 'exc_traceback'
     *tb = tstate->exc_traceback;
                 ^
mlpy/gsl/gsl.c: In function '__Pyx_ExceptionReset':
mlpy/gsl/gsl.c:4233:22: error: 'PyThreadState {aka struct _ts}' has no member named 'exc_type'
     tmp_type = tstate->exc_type;
                      ^
mlpy/gsl/gsl.c:4234:23: error: 'PyThreadState {aka struct _ts}' has no member named 'exc_value'
     tmp_value = tstate->exc_value;
                       ^
mlpy/gsl/gsl.c:4235:20: error: 'PyThreadState {aka struct _ts}' has no member named 'exc_traceback'
     tmp_tb = tstate->exc_traceback;
                    ^
mlpy/gsl/gsl.c:4236:11: error: 'PyThreadState {aka struct _ts}' has no member named 'exc_type'
     tstate->exc_type = type;
           ^
mlpy/gsl/gsl.c:4237:11: error: 'PyThreadState {aka struct _ts}' has no member named 'exc_value'
     tstate->exc_value = value;
           ^
mlpy/gsl/gsl.c:4238:11: error: 'PyThreadState {aka struct _ts}' has no member named 'exc_traceback'
     tstate->exc_traceback = tb;
           ^
In file included from /Users/martin/.virtualenvs/BA/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:21:0,
                 from /Users/martin/.virtualenvs/BA/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from mlpy/gsl/gsl.c:227:
mlpy/gsl/gsl.c: At top level:
/Users/martin/.virtualenvs/BA/lib/python3.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1463:1 warning: '_import_array' defined but not used [-Wunused-function]
 _import_array(void)
 ^
error: command 'gcc-5' failed with exit status 1 

我想这个解决方案与 有关,但我无法使用它,因为我不习惯 C++ 语法。我需要在哪里插入

    #define exc_type       exc_state.exc_type
    #define exc_value      exc_state.exc_value
    #define exc_traceback  exc_state.exc_traceback 

在文件 /usr/include/python3.7m/pystate.h 中,或者在我的情况下是虚拟环境中的文件?

通过删除由 Cython 创建并已包含在存档中的 mlpy 的所有子文件夹中的所有 .c 文件来解决。