无法在Conda环境中导入tensorflow ubuntu 16.04 python 3.6.4

无法在Conda环境中导入tensorflow ubuntu 16.04 python 3.6.4,tensorflow,Tensorflow,我是tensorflow的新手。我已通过以下步骤安装tensorflow: $conda create-n tensorflow pip python=3.6 $source激活tensorflow(tensorflow) $pip安装--忽略已安装--升级\ . (仅限) 但当我尝试运行以下程序时: import tensorflow as tf hello=tf.constant("Hello,TensorFlow!") sess=tf.Session() print=(sess.run(h

我是tensorflow的新手。我已通过以下步骤安装tensorflow:

$conda create-n tensorflow pip python=3.6 $source激活tensorflow(tensorflow) $pip安装--忽略已安装--升级\ . (仅限)

但当我尝试运行以下程序时:

import tensorflow as tf
hello=tf.constant("Hello,TensorFlow!")
sess=tf.Session()
print=(sess.run(hello))
我在
spyder
中发现了这个错误:

ModuleNotFoundError:没有名为“tensorflow”的模块

然而,
python
terminal我得到了这个错误:

2018-05-16 13:54:34.054511:I tensorflow/core/platform/cpu\u feature\u guard.cc:140]您的cpu支持 未编译此TensorFlow二进制文件以使用的说明: SSE4.1 SSE4.2 AVX AVX2 FMA


有人能告诉我可能的原因吗?

在python终端中是正常警告。它告诉您,您的tensorflow安装不是从源代码编译的,而是经过额外优化的。但是大多数用户没有这种优化

spyder中的错误是:必须设置程序以使用“tensorflow”环境。这里有很好的解释:。

警告之前已经讨论过了