【发布时间】:2019-11-11 20:57:21
【问题描述】:
我安装了最新的anaconda navigator 1.9.7(windows 10),在anaconda navigator界面新建了一个env(python 3.7),然后在里面安装了jupyter notebook和tensorflow 2.0包。
当我尝试按如下方式导入 tensorflow 时
import tensorflow as tf
我收到了这个错误
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-64156d691fe5> in <module>
----> 1 import tensorflow as tf
~\AppData\Roaming\Python\Python37\site-packages\tensorflow\__init__.py in <module>
26
27 # pylint: disable=g-bad-import-order
---> 28 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
29 from tensorflow.python.tools import module_util as _module_util
30
~\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\__init__.py in <module>
47 import numpy as np
48
---> 49 from tensorflow.python import pywrap_tensorflow
50
51 # Protocol buffers
~\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
23 import traceback
24
---> 25 from tensorflow.python.platform import self_check
26
27
ModuleNotFoundError: No module named 'tensorflow.python.platform'
我试过用
pip uninstall tensorflow
pip install tensorflow
和 在那个目录中重做它
到目前为止没有任何效果。
有什么建议吗?
【问题讨论】:
-
你用 3
-
3.6 有效,但我需要卸载并重新安装 tensorflow。不知道是什么原因。
标签: python-3.x windows tensorflow jupyter-notebook anaconda