使用python 3安装TensorFlow有什么要求?

时间:2016-08-29 01:21:34

标签: python tensorflow

我正在尝试使用已启用的GPU安装TensorFlow。为此,我使用了the official site的说明。首先,我创建了我的环境:

conda create --name tf_py3_tf_gpu python=3.5

然后我激活了我的环境并获得了适合我的机器的版本:

export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow-0.10.0rc0-py3-none-any.whl

然后我继续运行pip3 install:

(tf_py3_tf_gpu)user~/envs/tf_py3_tf_gpu/lib/python3.5/site-packages $ pip3 install --upgrade $TF_BINARY_URL

但错误:

-bash: pip3: command not found

但是,我连接到的集群不允许我使用apt-install来安装pip3(如果有办法将它安装到conda环境或某种类型的东西它会很棒!我是允许这样做,我确实有正常的点数。)

无论如何,我继续用普通的点子来做它是否有效:

pip install --ignore-installed --upgrade $TF_BINARY_URL

然而,它失败了消息:

(tf_py3_tf_gpu)user~/envs/tf_py3_tf_gpu/lib/python3.5/site-packages $ pip install --upgrade $TF_BINARY_URL
Collecting tensorflow==0.10.0rc0 from https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow-0.10.0rc0-py3-none-any.whl
  Using cached https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow-0.10.0rc0-py3-none-any.whl
Requirement already up-to-date: numpy>=1.10.1 in /home/user/envs/tf_py3_tf_gpu/lib/python3.5/site-packages (from tensorflow==0.10.0rc0)
Requirement already up-to-date: six>=1.10.0 in /home/user/envs/tf_py3_tf_gpu/lib/python3.5/site-packages (from tensorflow==0.10.0rc0)
Collecting protobuf==3.0.0b2 (from tensorflow==0.10.0rc0)
  Using cached protobuf-3.0.0b2-py2.py3-none-any.whl
Requirement already up-to-date: wheel>=0.26 in /home/user/envs/tf_py3_tf_gpu/lib/python3.5/site-packages (from tensorflow==0.10.0rc0)
Collecting setuptools (from protobuf==3.0.0b2->tensorflow==0.10.0rc0)
  Using cached setuptools-26.0.0-py2.py3-none-any.whl
Installing collected packages: setuptools, protobuf, tensorflow
  Found existing installation: setuptools 25.1.6
Cannot remove entries from nonexistent file /home/user/envs/tf_py3_tf_gpu/lib/python3.5/site-packages/easy-install.pth

由于某种原因它需要/home/user/envs/tf_py3_tf_gpu/lib/python3.5/site-packages/easy-install.pth我不知道为什么需要它。从这个错误中我不清楚错误是由于点数或错误是什么或是什么原因造成的。

不幸的是,我不知道如何在我连接的集群中安装pip3,因为我没有权限安装它。我尝试用普通的pip运行命令似乎不起作用。任何想法如何解决这一问题?或者安装pip3或那种类型的东西?我很高兴澄清允许在群集上使用哪些工具(比如我允许使用普通的pip并使用conda环境)。

更新

实际上,它似乎是使用python 3的pip版本(即使命令不是pip3,不确定是否有所作为,但我应该提到这一点):

(tf_py3_tf_gpu)user/path $ pip --version
pip 8.1.2 from /home/user/envs/tf_py3_tf_gpu/lib/python3.5/site-packages (python 3.5)

1 个答案:

答案 0 :(得分:0)

验证您的virtualenv的pip文件夹中是否不存在bin

尝试使用/path/to/python -m pip [...]确保使用正确的pip

重命名您的~/.local文件夹,因为conda venv尝试使用它们,即使它们与安装无关

如果其他所有方法都失败,请尝试pip install --user [...]