AttributeError: Module 'enum' Has No Attribute 'IntFlag' in Python 3.6.1
When encountering an AttributeError indicating that the enum module lacks the IntFlag attribute, it's crucial to inspect your installed Python packages. Often, this error stems from an outdated or conflicting enum implementation.
One possible cause is the presence of the enum34 package, which provides compatibility with Python 3.4 and earlier versions. However, with Python 3.6 and later, enum34's implementation is no longer necessary. To verify whether enum34 is interfering, check the value of enum.__file__. If it points to a location outside of the standard Python library directory (e.g., not '/usr/local/lib/python3.6/enum.py'), it's likely that enum34 is installed.
To resolve the issue, uninstall enum34 using:
pip uninstall -y enum34
If you require compatibility for code that runs on Python versions both before and after 3.4, consider using the enum-compat package, which only installs enum34 for pre-3.4 Python versions where the standard enum library is absent.
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3