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

问题描述 投票:0回答:1

试图在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 

usrincludepython3.7mpstate.h文件中,还是在我的虚拟环境中?

python c++ cython macos-catalina
1个回答
0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.