Why Python 3.6.1 throws AttributeError: module 'enum' has no attribute 'IntFlag'?

前端 未结 17 1328
无人共我
无人共我 2020-11-22 16:34

I just installed Python 3.6.1 for MacOS X

When I attempt to run the Console(or run anything with Python3), this error is thrown:

  AttributeError: mo         


        
17条回答
  •  温柔的废话
    2020-11-22 17:07

    DISCLAIMER: Please, @juanpa.arrivillaga, if you see this answer, feel free to write your own and I will remove this post.

    @juanpa.arrivillaga had mentioned above:

    Is there a file name enum.py in your working directory, by any chance?

    This was the issue I encountered. I was not aware of the enum module on python at the time and had named my test file enum.py.

    Since the file name is the module name, there was a conflict. More info on modules here: https://docs.python.org/2/tutorial/modules.html

提交回复
热议问题