Pyinstaller:将.py文件打包为.exe出现:AttributeError: module 'enum' has no attribute 'IntFlag'?

博主的环境如下:

Windows 10-10.0.17134-SP0

PyInstaller  3.3

PyQt  5.9.2

Python  3.6.3

使用PyQt写了一个小程序,现在需要将其打包为exe文件方便移植。使用pyinstall命令:

pyinstaller -F mainshishi.py

进行打包时出现:

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

以及:

AttributeError: 'str' object has no attribute 'items' 

经查阅之后,发现是因为电脑里安装了enum34这个包 ,这个包与python自带的enum包冲突了,因此使用uninstall命令将其卸载即可!

完成卸载之后再用以上命令打包,发现打包成功:

且程序能够正常运行:

猜你喜欢

转载自blog.csdn.net/qq_15969343/article/details/84872743