为什么 python2.7 导入 "from tensorflow.python.util import nest " 失败

Why python2.7 import "from tensorflow.python.util import nest " failed

我用过python2.7失败了

在 python2.7

>>> from tensorflow.python.util import nest 
Traceback (most recent calllast): 
  File "<stdin>", line 1, in <module> 
ImportError: cannot import name nest

但我尝试使用 python3.5 到 运行 from tensorflow.python.util import nest 没问题

我能够 运行 在 python 2.7 上毫无问题地导入该语句。也许您的 python 2 安装不稳定或者您的 tensorflow 已过时(我 运行ning 0.12.0-rc1)。

Python 2.7.12 (default, Dec  1 2016, 21:24:23) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
>>> from tensorflow.python.util import nest 
>>>