Traceback (most recent call last):
File "F:/fzy/python/corepython/tensorflow-test.py", line 1, in <module>
import tensorflow as tf
File "E:\anacoda\Lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import *
File "E:\anacoda\Lib\site-packages\tensorflow\python\__init__.py", line 30, in <module>
import traceback
File "E:\anacoda\lib\traceback.py", line 5, in <module>
import linecache
File "E:\anacoda\lib\linecache.py", line 11, in <module>
import tokenize
File "E:\anacoda\lib\tokenize.py", line 33, in <module>
import re
File "E:\anacoda\lib\re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
我安装tensorflow并发现此错误,但我不知道conda是如何导致它的。
答案 0 :(得分:0)
作为猜测,发生了以下事情之一:
pip install enum
- 与stdlib版本不同的enum
包,它隐藏了stdlib版本enum.py
文件 - 您创建了一个隐藏stdlib版本的enum.py
文件enum.py