当前位置:  开发笔记 > 编程语言 > 正文

在Ubuntu 14.04上安装tensorflow

如何解决《在Ubuntu14.04上安装tensorflow》经验,为你挑选了1个好方法。

我正在尝试遵循这些说明

sudo apt-get install python-pip python-dev

sudo pip install tensorflow

user@user-VirtualBox:~$ sudo pip install tensorflow
Downloading/unpacking tensorflow
  Could not find any downloads that satisfy the requirement tensorflow
Cleaning up...
No distributions at all found for tensorflow
Storing debug log for failure in /home/user/.pip/pip.log

这是pip日志:

user@user-VirtualBox:~$ cat /home/user/.pip/pip.log
------------------------------------------------------------
/usr/bin/pip run on Thu Jan 26 17:25:02 2017
Downloading/unpacking tensorflow
  Getting page https://pypi.python.org/simple/tensorflow/
  URLs to search for versions for tensorflow:
  * https://pypi.python.org/simple/tensorflow/
  Analyzing links from page https://pypi.python.org/simple/tensorflow/
    Skipping https://pypi.python.org/packages/00/16/c8ba385fc6511ca362f32326cd1d6a99bbbabbc8341607ff70c290e0be7b/tensorflow-0.12.1-cp34-cp34m-manylinux1_x86_64.whl#md5=981c0a406eb9865423b11c03b489040d (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/01/c5/adefd2d5c83e6d8b4a8efa5dd00e44dc05de317b744fb58aef6d8366ce2b/tensorflow-0.12.0-cp27-cp27mu-manylinux1_x86_64.whl#md5=ebcd1b32ccf2279bfa688542cbdad5fb (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/03/51/b68d9d6481d16fd709290030ae8a8a13212587bc87fae718e521bdafa723/tensorflow-0.12.0rc1-cp27-cp27mu-manylinux1_x86_64.whl#md5=9329984aa4f6388f5ec2a170e4ae968e (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/11/c9/2ec86336a8a401a57fabed5b10ee7f0493fc334b33e9672766b1149dd923/tensorflow-0.12.0-cp35-cp35m-win_amd64.whl#md5=d515d2ae08ae25fc8bf81e3374448146 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/16/6e/fa1f09a32d3ba5bf6a2b79c6ec16a43c91e3a79e0035ab3eb52ecad22e0d/tensorflow-0.12.1-cp35-cp35m-macosx_10_11_x86_64.whl#md5=faf5d055cdaecd75e5f0b37a04676102 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/25/23/24681ce011cd33ea5b22b8efd0f28a3f1294085c6ca6f70cc3abd62bf75d/tensorflow-0.12.0rc1-cp35-cp35m-macosx_10_11_x86_64.whl#md5=6c964e9575ed88892b94195a05aa8e65 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/25/c4/162ea5fa9e012f5a5e125105f6b290e56f9fd617a7aadd57d9a26bb386ca/tensorflow-0.12.0rc1-cp34-cp34m-manylinux1_x86_64.whl#md5=4e77b31ae9fc0e36489875ce0f72b267 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/33/4b/20e517870effa573405d30dafc22f330f24c0a8928659b4ad5a44b9a9af2/tensorflow-0.12.0rc0-cp35-cp35m-macosx_10_11_x86_64.whl#md5=8d1376a68f768efa57b1344fc2df0472 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/33/ab/3a62133d6c9f6281959f3ca96ad2a796fb4fed8d642c4f33d9fd97d8bf6f/tensorflow-0.12.0rc1-cp27-cp27m-macosx_10_11_x86_64.whl#md5=491802c10e992905d7e80108b9b16920 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/34/53/0e10581ad88bca25e5005874e46130b12efbd5eb1bda493dbf9b1648cbe2/tensorflow-0.12.1-cp27-cp27m-macosx_10_11_x86_64.whl#md5=d3f44a0596a623458c42c2a694abb0af (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/4a/c3/1ad85e5c4fde90b2e9a5101283d97dd41ba6c24f44a1c3a8495ef7098bb5/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl#md5=dad56a38acf7ca501b1bfeeef53f3710 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/64/9c/72aff7713c507f7e6c15df011e0ed18ac85e5bfa16c3763d8cba44585d79/tensorflow-0.12.0rc0-cp34-cp34m-manylinux1_x86_64.whl#md5=93431c5cd8a019d08a72e6c0a75eaaf4 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/64/a3/0054a3329579de44d557f491adbcaf8127809a7992bc46af80f0a589e29b/tensorflow-0.12.1-cp35-cp35m-win_amd64.whl#md5=d657836c76a5cd3c6d5560034bd7ade6 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/66/47/d6bb91a11684733ad565b891d561097ef10f8cb7bae87e5ad692207024e3/tensorflow-0.12.0rc1-cp35-cp35m-manylinux1_x86_64.whl#md5=2351fe799a0869487699537ab0e33019 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/67/06/15153c48b2281bc59f8a70f2ae681723ece29ebc0015883117fb28abaf68/tensorflow-0.12.0rc0-cp35-cp35m-manylinux1_x86_64.whl#md5=ebc1ee880633a60e5256e745a27d4058 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/7e/c6/837f4e249aae5c86a632eaaa9779e601eca1487772f8ad75c347bf9e813f/tensorflow-0.12.1-cp27-cp27mu-manylinux1_x86_64.whl#md5=c98fd26b79a97cc490c942bbafed5462 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/7e/ea/e42e47ddb39d2043a06dc93b5aec042bae8571be52ea664aa03246a83c32/tensorflow-0.12.0-cp35-cp35m-macosx_10_11_x86_64.whl#md5=f8b165ae638eb169220ccbf02658475b (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/90/cf/1d1e12f9f39b6a0ed1c49792ef5ce7615dddc2ce7287fc83ede0dddb9b3c/tensorflow-0.12.0rc0-cp27-cp27m-macosx_10_11_x86_64.whl#md5=7be7b7488a6be83546758a40d5442901 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/91/7c/98b25b74241194d4312a7e230c85a77b254224191dbf17b484811f8a9f61/tensorflow-0.12.1-cp36-cp36m-macosx_10_11_x86_64.whl#md5=3b2f5f08fe61471ea973a4bdbdfbae43 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/96/d6/096f6624a8a48d41801eb23863d35a37532baf32f6d3aa2e03c96f66e6ab/tensorflow-0.12.0-cp34-cp34m-manylinux1_x86_64.whl#md5=a6a0af9cf2a5fc33053f638b05cb3940 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/9e/7c/f50ca985e43cff46a6d92abb088e8328b9be13335dc44af291ac1ed11862/tensorflow-0.12.0-cp35-cp35m-manylinux1_x86_64.whl#md5=2c07109df1a9865a7a44b6fe08756e8d (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/a7/86/cb47c1213779939583091fc97e0950c323d655186824cdbc0f657f42930c/tensorflow-0.12.0-cp27-cp27m-macosx_10_11_x86_64.whl#md5=fc429a5b5b74517e08216ee8b1d04e59 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/b2/da/9132af1e2ef3771b63619072a6d82800bd60acbf2c8bea8e4f26514c768a/tensorflow-0.12.0rc1-cp35-cp35m-win_amd64.whl#md5=69b6c2e9440fd2d7a2d86249933fcde0 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/e5/5c/56e6522fdcd6f8739dcbc4de62e8b0040e141785bb42e5b53a83b0ba3e58/tensorflow-0.12.1-cp35-cp35m-manylinux1_x86_64.whl#md5=c6e3ba8579754f37d37be26e863f9d95 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/e7/73/85ff235957f2652f78a2cd7f0a045d3f983302991cb7af2fddedf27d56fe/tensorflow-0.12.1-cp33-cp33m-manylinux1_x86_64.whl#md5=d77e48ef3b45e543ca165db93f27e0ff (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/e9/a5/45b172f20e2fabd19c7f18a44570fc82acc4c628ec9bc4b313de39c4fe37/tensorflow-0.12.1-cp36-cp36m-manylinux1_x86_64.whl#md5=def6ab7dc3930f34f3000caef34f4333 (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
    Skipping https://pypi.python.org/packages/f6/2a/e5bb6320a3fc2886f2677ffa0d4396eefb5914cfc19db94e672c650f0700/tensorflow-0.12.0rc0-cp27-cp27mu-manylinux1_x86_64.whl#md5=00a6b89122d86fd527558a2740fd6f8f (from https://pypi.python.org/simple/tensorflow/) because it is not compatible with this Python
  Could not find any downloads that satisfy the requirement tensorflow
Cleaning up...
  Removing temporary dir /tmp/pip_build_root...
No distributions at all found for tensorflow
Exception information:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1178, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "/usr/lib/python2.7/dist-packages/pip/index.py", line 277, in find_requirement
    raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for tensorflow

据我所知它需要一些其他的python版本?我的python版本是 python --versionPython 2.7.6

我也尝试过(它有效):

export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.1-cp27-none-linux_x86_64.whl

sudo pip install --upgrade $TF_BINARY_URL

但我想知道为什么安装sudo pip install tensorflow不工作?



1> 小智..:

这通常是因为您调用了低于8.1的点数版本,运行

pip install --upgrade pip
pip install --upgrade tensorflow

如果上面的代码不起作用,请尝试通过发出以下格式的命令在活动的virtualenv环境中安装TensorFlow:

 (tensorflow)$ pip install --upgrade TF_PYTHON_URL   # Python 2.7
 (tensorflow)$ pip3 install --upgrade TF_PYTHON_URL  # Python 3.N 

其中TF_PYTHON_URL标识TensorFlow Python包的URL.TF_PYTHON_URL的适当值取决于操作系统,Python版本和GPU支持.查找TF_PYTHON_URL为您的系统的相应值这里.例如,如果要安装TensorFlow for Linux,Python 2.7和仅CPU支持,请发出以下命令在活动virtualenv环境中安装TensorFlow:

(tensorflow)$ pip3 install --upgrade \
 https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.1.0-cp34-cp34m-linux_x86_64.whl

更多细节在Tensorflow官方网站上.

推荐阅读
保佑欣疼你的芯疼
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有