1

I have read and tried every comments here: Why Python 3.6.1 throws AttributeError: module 'enum' has no attribute 'IntFlag'? but still, it is of no help.

I am using Pycharm Pycharm 2018.3 Community Edition and my Python version is 3.7

I have this error everytime I try to setup an interpreter for Pycharm:

Error in sitecustomize; 
set PYTHONVERBOSE for traceback: AttributeError: module 'enum' has no attribute 'IntFlag'
Traceback (most recent call last):   File "/Applications/PyCharm CE.app/Contents/helpers/packaging_tool.py", line 2, in <module>
import traceback   File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/traceback.py", line 5, in <module>
import linecache   File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/linecache.py", line 11, in <module>
import tokenize   File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tokenize.py", line 33, in <module>
import re   File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/re.py", line 143, in <module>
class RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag'

Hope to get help.

yedpodtrzitko
  • 9,035
  • 2
  • 40
  • 42

1 Answers1

6

I had the same problem inside PyCharm a simple program did not run. outside PyCharm I had no issues. after comparing python -v this is what happened

lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'

a successful run used lib/python3.6/__pycache__/re.cpython-36.pyc' and then 
/lib/python3.6/__pycache__/enum.cpython-36.pyc'

while the failed run included: lib/python3.6/__pycache__/re.cpython-36.pyc'
and then: google_appengine/lib/grpcio-1.9.1/enum/__pycache__/__init__.cpython-36.pyc 

after disabling App Engine Support in PyCharm all worked fine.

rawwar
  • 4,834
  • 9
  • 32
  • 57
Franz
  • 61
  • 3