我从源代码安装了Tensorflow 1.9.0。
conda create -n tensorflow python = 2.7
source activate tensorflow
pip install /tmp/tensorflow_pkg/tensorflow-1.9.0rc0-cp27-cp27mu-linux_x86_64.whl
(tensorflow)usename @ lab:$ pip install /tmp/tensorflow_pkg/tensorflow-1.9.0rc0-cp27-cp27mu-linux_x86_64.whl 处理 /tmp/tensorflow_pkg/tensorflow-1.9.0rc0-cp27-cp27mu-linux_x86_64.whl 要求已经满足:protobuf> = 3.4.0 in /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 tensorflow == 1.9.0rc0)(3.6.0)要求已经满足: astor> = 0.6.0 in /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 tensorflow == 1.9.0rc0)(0.6.2)要求已经满足: backports.weakref> = 1.0rc1 in /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 tensorflow == 1.9.0rc0)(1.0.post1)要求已经满足: setuptools< = 39.1.0 in /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 tensorflow == 1.9.0rc0)(39.1.0)要求已经满足:转入 /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 tensorflow == 1.9.0rc0)(0.31.1)要求已经满足: mock> = 2.0.0 in /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 tensorflow == 1.9.0rc0)(2.0.0)要求已经满足: enum34> = 1.1.6 in /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 tensorflow == 1.9.0rc0)(1.1.6)要求已经满足: gast> = 0.2.0 in /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 tensorflow == 1.9.0rc0)(0.2.0)要求已经满足: termcolor> = 1.1.0 in /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 tensorflow == 1.9.0rc0)(1.1.0)要求已经满足: absl-py> = 0.1.6 in /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 tensorflow == 1.9.0rc0)(0.2.2)要求已经满足: 6> = 1.10.0 in /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 tensorflow == 1.9.0rc0)(1.11.0)要求已经满足: tensorboard< 1.9.0,> = 1.8.0 in /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 tensorflow == 1.9.0rc0)(1.8.0)要求已经满足: grpcio> = 1.8.6 in /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 tensorflow == 1.9.0rc0)(1.12.1)要求已经满足: numpy> = 1.13.3 in /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 tensorflow == 1.9.0rc0)(1.14.5)要求已经满足: funcsigs> = 1; python_version< " 3.3"在 /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 mock> = 2.0.0-> tensorflow == 1.9.0rc0)(1.0.2)要求已经 满意:pbr> = 0.11 in /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 mock> = 2.0.0-> tensorflow == 1.9.0rc0)(4.0.4)已经要求了 满意:漂白== 1.5.0 in /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 tensorboard< 1.9.0,> = 1.8.0-> tensorflow == 1.9.0rc0)(1.5.0)要求 已满意:期货> = 3.1.1; python_version< " 3"在 /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 tensorboard< 1.9.0,> = 1.8.0-> tensorflow == 1.9.0rc0)(3.2.0)要求 已满意:降价> = 2.6.8 in /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 tensorboard< 1.9.0,> = 1.8.0-> tensorflow == 1.9.0rc0)(2.6.11)要求 已满意:werkzeug> = 0.11.10 in /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 张量板< 1.9.0,> = 1.8.0-> tensorflow == 1.9.0rc0)(0.14.1)要求 已满意:html5lib == 0.9999999 in /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages(来自 tensorboard< 1.9.0,> = 1.8.0-> tensorflow == 1.9.0rc0)(0.9999999) 安装收集的软件包:tensorflow已成功安装 tensorflow-1.9.0rc0
Python 2.7.15 | Anaconda custom(64位)| (默认,2018年5月1日, 23:32:55)[GCC 7.2.0]关于linux2 Type" help"," copyright"," credits"要么 "许可证"了解更多信息。
导入tensorflow Traceback(最近一次调用最后一次):文件"",第1行,在ImportError中:没有名为tensorflow的模块
(tensorflow)usename @ lab:$ pip show tensorflow名称: tensorflow版本:1.9.0rc0摘要:TensorFlow是一个开源的 每个人的机器学习框架。主页: official web作者:Google Inc.作者电子邮件: opensource@google.com许可证:Apache 2.0位置: /home/csf/anaconda2/envs/tensorflow/lib/python2.7/site-packages 需要:protobuf,astor,backports.weakref,setuptools,wheel,mock, enum34,gast,termcolor,absl-py,six,tensorboard,grpcio,numpy 需要逐:
那么,为什么我可以导入tensorflow? 提前谢谢!
Ubuntu 16.04 CUDA:9.1 cudnn:7.0.5
答案 0 :(得分:0)
您确定使用pip 2.7进行安装吗?如果你没有指定它可能已经安装了更新版本的python,从而导致预期的2.7模块不存在。
答案 1 :(得分:0)
在anaconda中,您可以使用anaconda导航器来安装软件包。只需转到“环境和root”,然后在下拉框中选择“未安装”。从那里您可以选择tensorflow并安装它。我认为,从您可能不再需要该日期的日期来看,也许其他人可以使用该信息。