👻 Check our latest review to choose the best laptop for Machine Learning engineers and Deep learning tasks!
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: module "enum" has no attribute "IntFlag"
$ /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
Failed to import the site module
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site.py", line 544, in <module>
main()
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site.py", line 530, in main
known_paths = addusersitepackages(known_paths)
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site.py", line 282, in addusersitepackages
user_site = getusersitepackages()
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site.py", line 258, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site.py", line 248, in getuserbase
USER_BASE = get_config_var("userbase")
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/sysconfig.py", line 601, in get_config_var
return get_config_vars().get(name)
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/sysconfig.py", line 580, in get_config_vars
import _osx_support
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/_osx_support.py", line 4, in <module>
import re
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module "enum" has no attribute "IntFlag"
The class IntFlag exists within enum.py. So, why is the AttributeError being thrown?
👻 Read also: what is the best laptop for engineering students?
We hope this article has helped you to resolve the problem. Apart from Why Python 3.6.1 throws AttributeError: module “enum” has no attribute “IntFlag”?, check other __main__ Python module-related topics.
Want to excel in Python? See our review of the best Python online courses 2023. If you are interested in Data Science, check also how to learn programming in R.
By the way, this material is also available in other languages:
- Italiano Why Python 3.6.1 throws AttributeError: module “enum” has no attribute “IntFlag”?
- Deutsch Why Python 3.6.1 throws AttributeError: module “enum” has no attribute “IntFlag”?
- Français Why Python 3.6.1 throws AttributeError: module “enum” has no attribute “IntFlag”?
- Español Why Python 3.6.1 throws AttributeError: module “enum” has no attribute “IntFlag”?
- Türk Why Python 3.6.1 throws AttributeError: module “enum” has no attribute “IntFlag”?
- Русский Why Python 3.6.1 throws AttributeError: module “enum” has no attribute “IntFlag”?
- Português Why Python 3.6.1 throws AttributeError: module “enum” has no attribute “IntFlag”?
- Polski Why Python 3.6.1 throws AttributeError: module “enum” has no attribute “IntFlag”?
- Nederlandse Why Python 3.6.1 throws AttributeError: module “enum” has no attribute “IntFlag”?
- 中文 Why Python 3.6.1 throws AttributeError: module “enum” has no attribute “IntFlag”?
- 한국어 Why Python 3.6.1 throws AttributeError: module “enum” has no attribute “IntFlag”?
- 日本語 Why Python 3.6.1 throws AttributeError: module “enum” has no attribute “IntFlag”?
- हिन्दी Why Python 3.6.1 throws AttributeError: module “enum” has no attribute “IntFlag”?
New York | 2023-03-21
Thanks for explaining! I was stuck with Why Python 3.6.1 throws AttributeError: module “enum” has no attribute “IntFlag”? for some hours, finally got it done 🤗. Will use it in my bachelor thesis
Paris | 2023-03-21
Thanks for explaining! I was stuck with Why Python 3.6.1 throws AttributeError: module “enum” has no attribute “IntFlag”? for some hours, finally got it done 🤗. Checked yesterday, it works!
Berlin | 2023-03-21
Maybe there are another answers? What Why Python 3.6.1 throws AttributeError: module “enum” has no attribute “IntFlag”? exactly means?. Checked yesterday, it works!