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

前端 未结 17 1074
无人共我
无人共我 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:11

    If you having this issue when running tests in PyCharm, make sure the second box is unchecked in the configurations.

    0 讨论(0)
  • 2020-11-22 17:13

    Unfortunately none of the suggestions helped me, but after some more googling this

    pip install aenum
    

    solved it for me

    0 讨论(0)
  • 2020-11-22 17:15

    When ever I got this problem:

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

    simply first i run the command:

    unset PYTHONPATH 
    

    and then run my desired command then got success in that.

    0 讨论(0)
  • 2020-11-22 17:17

    In case you have to keep PYTHONPATH for both python2 and python3, you can write alias statements to set the proper PYTHONPATH in your bash_profile:

    Hardcode your PYTHONPATH2, and PYTHONPATH3 variables in your ~/.bash_profile, and add the following aliases at the end of it:

    alias python='export PYTHONPATH=${PYTHONPATH2};python'
    alias python3='export PYTHONPATH=${PYTHONPATH3};python3'
    

    My python (refers to python2) as I use python2 more often.

    0 讨论(0)
  • 2020-11-22 17:18

    Disabling "Google App Engine Support" in pycharm preferences fixed this issue for me.

    pycharm app engine preferences

    0 讨论(0)
提交回复
热议问题