zl程序教程

您现在的位置是:首页 >  其它

当前栏目

已解决AttributeError: module ‘enum‘ has no attribute ‘IntFlag‘?

解决 No module has attribute AttributeError Enum
2023-09-27 14:27:32 时间

已解决AttributeError: module ‘enum‘ has no attribute ‘IntFlag‘?

在这里插入图片描述

报错问题

之前在工作中遇到过这个坑,记录一下问题以及解决方法,不一定针对所有情况都能用,但是可以供大家参考。
问题描述如下:

AttributeError: module ‘enum’ has no attribute ‘IntFlag’?

在这里插入图片描述

解决方法

在这里插入图片描述
这可能是由包Enum34引起的。因为Python3.4有一个标准库枚举模块,所以您应该卸载Enum34,因为在Python3.6中添加了Enum.Intflag,所以它不再与标准库中的枚举兼容。

pip uninstall enum34   #卸载enum34

PS

有问题评论区留言即可