Loading [MathJax]/jax/output/CommonHTML/config.js
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >Python3.7MLpy安装错误- 'PyThreadState {aka struct _ts}‘没有名为'exc_type’的成员

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

Stack Overflow用户
提问于 2020-04-23 08:34:30
回答 1查看 2.1K关注 0票数 0

尝试在macOS Catalina上的虚拟环境中安装mlpy 3.5.0时,我收到一个错误。

代码语言:javascript
运行
AI代码解释
复制
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 

我猜这个解决方案与this answer有关,但我无法让它工作,因为我不习惯C++语法。我需要在哪里插入

代码语言:javascript
运行
AI代码解释
复制
    #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中,或者在我的例子中,在我的虚拟环境中?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-04-23 11:03:23

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61382768

复制
相关文章
error: PyThreadState {aka struct _ts} has no member named exc_type
这是因为你使用的Cython的版本与生成.c文件的版本不一致,此时应该使用Cython重新的生成.c文件。但是你会发现你重新生成的时候依然回报错。主要因为当目录中以及有一个相关的.c文件的时候Cython是不会重新生成的。
狼啸风云
2020/08/10
1.7K0
server.c:5491:15: 错误:‘struct redisServer’没有名为‘maxmemory’的成员
错误原因是gcc版本的问题,由于我使用的redis6.0版本的。查看gcc版本,如下所示:
别先生
2021/03/02
4.5K0
cython编译错误
running build_extskipping ‘bbox.c’ Cython extension (up-to-date)skipping ‘nms.c’ Cython extension (up-to-date)building ‘cython_bbox’ extension{‘gcc’: [’-Wno-cpp’, ‘-Wno-unused-function’]}gcc -pthread -B /home/gsadhasivam/anaconda3/envs/r3det/compiler_compa
狼啸风云
2021/01/05
1.6K0
《Python 源码剖析》一些理解以及勘误笔记(1)
以下是本人阅读此书时理解的一些笔记,包含一些影响文义的笔误修正,当然不一定正确,贴出来一起讨论。 注:此书剖析的源码是2.5版本,在python.org 可以找到源码。纸质书阅读,pdf 贴图。 文章
s1mba
2017/12/26
9800
《Python 源码剖析》一些理解以及勘误笔记(1)
Python 的多线程与 GIL
Python从0.9.8版就开始支持多线程( thread模块),1.5.1版引入了 threading高级模块,是对thread模块的封装。
CS实验室
2021/03/22
1K0
Python 的多线程与 GIL
golang type struct 只写成员类型的 匿名字段。
这真是蛋疼了。*sql.DB是什么鬼啊?为什么只有类型没有字段名啊?看来没有系统看过golang语法真是够呛。发个QQ在群里面问golang达人,趁着别人还没回复的功夫,自己想百度一下,可是这怎么百度啊?怎么描述这个问题啊?奇葩啊。后来没办法直接百度了关键字 golang type struct ...翻了几页结果,还真翻到了。原来struct中只写一个类型不写字段名定义的字段叫做匿名字段。为啥不用名字呢?因为golang把这个类型的所有成员到装到了当前struct中。直接当前struct.XXX就能访问这个类型的子成员了。公然偷懒偷到这种程度了,我对golang真是大写的服啊。不过省了不少事啊。
xiny120
2019/06/11
7230
Ts安装及自动编译ts文件
VsCode打开 终端 ->运行任务 -> typescript ->“tsc: 监视 - tsconfig.json (ts)”
明知山
2020/09/08
2.4K0
【Linux 内核 内存管理】内存映射相关数据结构 ④ ( vm_area_struct 结构体成员分析 | vm_ops 成员 | vm_operations_struct 结构体成员分析 )
在博客 【Linux 内核 内存管理】虚拟地址空间布局架构 ⑦ ( vm_area_struct 结构体成员分析 | vm_start | vm_end | vm_next | vm_prev |vm_rb) 中 , 分析了 vm_start vm_end vm_next vm_prev vm_rb 这
韩曙亮
2023/03/30
2K0
【Linux 内核 内存管理】内存映射相关数据结构 ④ ( vm_area_struct 结构体成员分析 | vm_ops 成员 | vm_operations_struct 结构体成员分析 )
Sodinokibi(aka REvil)勒索软件
Sodinokibi(又名REvil)在过去的几年里一直是最多产的勒索软件即服务(RaaS)组织之一。据称,这一勒索软件家族是Travelex 入侵事件的幕后黑手,目前的报道指出,针对Acer(宏碁)的一次攻击,要求支付5000万美元的赎金。
Al1ex
2021/07/21
1.5K0
Sodinokibi(aka REvil)勒索软件
typescript TS7053错误解决
typescript中使用变量作为索引来访问未知类型,例如泛型对象成员时,会报错TS7053
路过君
2022/04/13
1K0
类A是公共的,应在名为A.java的文件中声明错误
第一种!!! “类A是公共的,应在名为A.java的文件中声明”这句话需要分两步来理解: 1、如果类A被声明为公共的(public),那么必须将类A保存在名为A.java的文件中; 2、反之,在一个文件中最多包含一个顶级的公共类,并且该公共类的名字与文件名相同。比如文件A.java中,允许定义一个或多个类,但最多允许一个顶级的公共类,此类名为A。此处强调的顶级的意思是,允许非顶级的公共类存在,如内部公共类等。 第二种 这是你的命名错误 把文件名改为 A.java 因为你里面的类是 pub
Angel_Kitty
2018/04/09
2.7K0
MySQL没有启动成功,没有报告任何错误
问题描述: 在使用"net start mysqld" 的时候出现: MySQL 服务正在启动… MySQL 服务无法启动。
vincentbbli
2021/08/18
3.2K0
C语言的struct和typedef struct
分三块来讲述: 1 首先://注意在C和C++里不同 在C中定义一个结构体类型要用typedef:
狼啸风云
2022/11/21
8760
【Linux 内核 内存管理】内存映射相关数据结构 ③ ( vm_area_struct 结构体成员分析 | shared 成员 | anon_vma_chain 成员 | anon_vma 成员 )
在博客 【Linux 内核 内存管理】虚拟地址空间布局架构 ⑦ ( vm_area_struct 结构体成员分析 | vm_start | vm_end | vm_next | vm_prev |vm_rb) 中 , 分析了 vm_start vm_end vm_next vm_prev vm_rb 这
韩曙亮
2023/03/30
2.5K0
安装和使用cmak(原名为kafka manager)
Java -version确认已经切换版本成功,要不centos 7默认自带的是java8 java1.8.
mariolu
2020/06/28
8K2
struct 与 typedef struct
1. 基本解释   typedef为C语言的关键字,作用是为一种数据类型定义一个新名字。这里的数据类型包括内部数据类型(int,char等)和自定义的数据类型(struct等)。   在编程中使用typedef目的一般有两个,一个是给变量一个易记且意义明确的新名字,另一个是简化一些比较复杂的类型声明。   至于typedef有什么微妙之处,请你接着看下面对几个问题的具体阐述。 2. typedef & 结构的问题   当用下面的代码定义一个结构时,编译器报了一个错误,为什么呢?莫非C语言不允许在结构中包含
猿人谷
2018/01/17
1.3K0
struct和typedef struct
typedef声明,简称typedef,为现有类型创建一个新的名字,或称为类型别名,在结构体定义,还有一些数组等地方都大量的用到。 比如: typedef int DataType; 给整型int起了一个新名字DataType,以后用DataType就如同int一样。 分三块来讲述:   1 首先://注意在C和C++里不同     在C中定义一个结构体类型要用typedef:     typedef struct Student     {     int a;     }Stu;     于是在声明变量的时候就可:Stu stu1;(如果没有typedef就必须用struct Student stu1;来声明)     这里的Stu实际上就是struct Student的别名。Stu==struct Student     另外这里也可以不写Student(于是也不能struct Student stu1;了,必须是Stu stu1;)     typedef struct     {     int a;     }Stu;     但在c++里很简单,直接     struct Student     {     int a;     };         于是就定义了结构体类型Student,声明变量时直接Student stu2;
谙忆
2021/01/19
6490
C语言边角料:结构体中指针类型的成员变量,它的类型重要吗?
昨天在编译代码的时候,之前一直OK的一个地方,却突然出现了好几个 Warning!
IOT物联网小镇
2021/05/13
5680
深度讲解TS:这样学TS,迟早进大厂【02】:安装 TypeScript
以上命令会在全局环境下安装 tsc 命令,安装完成之后,我们就可以在任何地方执行 tsc 命令了。
江一铭
2022/06/17
5460
【Linux 内核 内存管理】内存映射相关数据结构 ② ( vm_area_struct 结构体成员分析 | vm_mm 成员 | vm_page_prot 成员 | vm_flags 成员 )
在之前的博客 【Linux 内核 内存管理】虚拟地址空间布局架构 ⑦ ( vm_area_struct 结构体成员分析 | vm_start | vm_end | vm_next | vm_prev |vm_rb) 中 , 分析了 vm_start vm_end vm_next vm_prev vm_rb 这
韩曙亮
2023/03/30
4.2K0
【Linux 内核 内存管理】内存映射相关数据结构 ② ( vm_area_struct 结构体成员分析 | vm_mm 成员 | vm_page_prot 成员 | vm_flags 成员 )

相似问题

错误:‘PyThreadState’{又名‘struct_ts’}没有名为‘exc_type’的成员;你的意思是‘curexc_type’吗?在构建Cython扩展时

25

“GtkWidget {aka struct _GtkWidget}”没有名为“window”的成员

1108

‘_timer’{aka‘struct timer_list’}没有名为‘data’的成员

16

'GtkToggleButton {aka struct _GtkTogglebutton}‘没有成员'active’

10

错误:‘struct’没有名为‘msg_iov’的成员

11
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档