使用pip未找到TensorFlow

我正在尝试使用pip安装TensorFlow。

$ pip install tensorflow --user
Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow

我做错了什么?到目前为止,我使用Python和pip,没有任何问题。

你需要一个64位的Python版本,而在你的例子中,你使用的是32位版本。到目前为止,Tensorflow只支持Windows上的 "64位版本的Python 3.5.x和3.6.x"。

要检查你正在运行的Python版本,可以输入pythonpython3来启动解释器,然后输入import struct;print(struct.calcsize("P") * 8),这将打印3264来告诉你正在运行的Python的位版本。

评论(12)

从tensorflow网站上看到:"你需要pip 8.1或更高版本才能使用以下命令"。运行这个命令来升级你的pip,然后再尝试安装tensorflow。

pip install --upgrade pip
评论(6)

2016年11月28日更新: TensorFlow现在可以在PyPI中使用,从0.12版本开始。你可以输入

pip install tensorflow

...或...

pip install tensorflow-gpu

...分别安装TensorFlow的CPU-only或GPU-accelerated版本。


以前的回答: TensorFlow还没有在PyPI资源库中,所以你必须为你的操作系统和Python版本指定适当的"轮子文件"的URL。

支持的配置的完整列表列在TensorFlow网站上,但例如,要在Linux上为Python 2.7安装0.10版本,只使用CPU,你可以输入以下命令。

$ pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0rc0-cp27-none-linux_x86_64.whl
评论(6)