亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么Python 3.6.1拋出AttributeError:模塊'enum'沒有屬性

為什么Python 3.6.1拋出AttributeError:模塊'enum'沒有屬性

繁星coding 2019-11-18 10:50:48
我剛剛為MacOS X安裝了Python 3.6.1當我嘗試運行控制臺(或使用Python3運行任何命令)時,拋出此錯誤:  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'  IntFlag類存在于enum.py中。那么,為什么會引發AttributeError?
查看完整描述

3 回答

?
揚帆大魚

TA貢獻1799條經驗 獲得超9個贊

對我來說,此錯誤是在安裝gcloud組件app-engine-python以便集成到pycharm后發生的。即使pycharm現在不上傳到app-engine,卸載模塊也有幫助。


查看完整回答
反對 回復 2019-11-18
  • 3 回答
  • 0 關注
  • 719 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號