环境:Ubuntu虚拟机 / python2.7
按照官网安装: $ pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
提示:Could not install packages due to an Environment Error: [Errno 13] Permission denied: “。。。balabal”
解决方案:
plan A:在pip之前加:sudo,问题解决!
plan B:还有一个方案是也可以在windows系统下用的,在后面加参数 --user(ps.不过还没亲自试过)
测试tensorflow代码:
import tensorflow as tf hello = tf.constant('Hello, TensorFlow!') sess = tf.Session() print sess.run(hello) a = tf.constant(10) b = tf.constant(32) print sess.run(a+b)