笔记|AttributeError: module ‘enum‘ has no attribute ‘IntFlag‘

使用pyinstaller 封装时报错

pyinstall -F myscript.py

错误:
AttributeError: module 'enum' has no attribute 'IntFlag' pre-safe-import-module hook failed, needs fixing.

参考
  • https://stackoverflow.com/questions/69151708/pyinstaller-python-pre-safe-import-module-hook-failed-needs-fixing
  • pyinstaller-attributeerror-module-enum-has-no-attribute-intflag
使用$ pip3 uninstall -y enum34 卸载enum34
$ pip3 uninstall -y enum34 WARNING: Ignoring invalid distribution -irtualenv (/Users/Rachel1900/anaconda3/lib/python3.7/site-packages) WARNING: Ignoring invalid distribution - (/Users/Rachel1900/anaconda3/lib/python3.7/site-packages) WARNING: Ignoring invalid distribution -irtualenv (/Users/Rachel1900/anaconda3/lib/python3.7/site-packages) WARNING: Ignoring invalid distribution - (/Users/Rachel1900/anaconda3/lib/python3.7/site-packages) Found existing installation: enum34 1.1.10 Uninstalling enum34-1.1.10: Successfully uninstalled enum34-1.1.10

重新运行打包
出现超出循环报错
RecursionError: maximum recursion depth exceeded

【笔记|AttributeError: module ‘enum‘ has no attribute ‘IntFlag‘】原因参考:
recursion-error-python

    推荐阅读