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

Error in PIP3 execution of multi version Python by windows: module ‘enum’ has no attribute ‘intflag’?

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

summary :

This machine is equipped with python2.7 and python3.6. There is no problem when executing PIP and PIP2. When executing PIP3, you will be prompted:

C:\Users\>pip3
Traceback (most recent call last):
  File "e:\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "e:\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "E:\Python36\Scripts\pip3.exe\__main__.py", line 2, in <module>
  File "e:\python36\lib\re.py", line 142, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'

reason:

English: This is likely caused by the package enum34. Since Python 3.4 there’s a standard library enum module, so you should install enum34, which is no longer compatible with the enum in the standard library since enum.intflag was added in Python 3.6

English: this may be caused by the enum34 package. Because there is a standard library enumeration module in Python 3.4, you should uninstall enum34, which is no longer compatible with enumerations in the standard library because enumerations. Intflag was added in Python 3.6

solutions:

pip uninstall enum34

#Uninstall enum34

After unloading, PIP3 was executed successfully. It took most of the day yesterday to solve the problem

C:\Users>pip3

Usage:
  pip3 <command> [options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  check                       Verify installed packages have compatible dependencies.
  config                      Manage local and global configuration.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion.
  help                        Show help for commands.