分享

Ubuntu 14.04

 木俊 2018-06-29

问题

欲使用命令:pip install https://storage./tensorflow/linux/cpu/tensor
flow-0.5.0-cp27-none-linux_x86_64.whl安装tensorflow时,在安装pip的步骤中,使用命令:
sudo apt-get install python-pip安装pip出现如下错误:
The following packages have unmet dependencies:
python-pip : Depends: python-pip-whl (= 1.5.4-1ubuntu3) but it is not going to be installed
Recommends: python-dev-all (>= 2.6) but it is not installable
E: Unable to correct problems, you have held broken packages.

解决方法

1、 sudo apt-get update
2、sudo apt-get upgrade
3、sudo apt-get install python-setuptools python-dev build-essential
4、sudo easy_install pip
5、最后使用命令:pip install https://storage./tensorflow/linux/cpu/
tensorflow-0.5.0-cp27-none-linux_x86_64.whl即可安装成功

测试代码及结果

打开一个 python 终端:
$ python
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print sess.run(hello)
Hello, TensorFlow!
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> print sess.run(a+b)
42
>>>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多