错误:AttributeError: module 'enum' has no attribute 'IntFlag'

错误:AttributeError: module 'enum' has no attribute 'IntFlag'

文章目录:

  • 一、错误原因
  • 二、解决错误方法:[参考](https://stackoverflow.com/questions/43124775/why-python-3-6-1-throws-attributeerror-module-enum-has-no-attribute-intflag)


最近在给python程序打包,需要用到pyinstaller 包,安装好之后在给程序打包的时候出现错误,虽然程序已经打包,但是打包好的程序并不能够正确执行!!!


一、错误原因

错误如下:
在这里插入图片描述

这是因为您enum不是标准的库enum模块。您可能已enum34安装该软件包。
检查是否属于这种情况的一种方法是检查财产 enum.file

import enum
print(enum.__file__)  
# standard library location should be something like 
# /usr/local/lib/python3.6/enum.py

二、解决错误方法:参考

从python 3.6开始,enum34库不再与标准库兼容。该库也是不必要的,因此您只需卸载它即可。
我安装的python版本是3.6.5版本的,所有直接卸载enum库即可
在这里插入图片描述
卸载enum34库

pip uninstall enum34

卸载之后,问题解决,大功告成!!!

在这里插入图片描述



在这里插入图片描述
♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠

你可能感兴趣的:(16_各种错误和bug(你的痛,我的痛,痛痛痛),enum,python错误)