我正在尝试使用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没有任何问题。


当前回答

试试这个:

export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.1-py3-none-any.whl
pip3 install --upgrade $TF_BINARY_URL

来源:https://www.tensorflow.org/get_started/os_setup(页面已不存在)

更新2/23/17 文档移至:https://www.tensorflow.org/install

其他回答

在Windows 10上,这里的任何东西都不适合我。也许下面的一个更新的解决方案确实对我有用。

Python -m PIP install——升级tensorflow。

这是在Windows 10上使用Python 3.6和tensorflow 1.5

如果你最近遇到了这个问题(比如,在2018年Python 3.7发布之后),这很可能是由于tensorflow方面缺乏Python 3.7支持造成的。如果您不介意,可以尝试使用Python 3.6。你可以从https://github.com/tensorflow/tensorflow/issues/20444上找到一些技巧,但使用它们的风险由你自己承担。我使用了harpone建议的方法——首先下载Python 3.6的tensorflow wheel,然后手动重命名它……

cp tensorflow-1.11.0-cp36-cp36m-linux_x86_64.whl tensorflow-1.11.0-cp37-cp37m-linux_x86_64.whl
pip install tensorflow-1.11.0-cp37-cp37m-linux_x86_64.whl

好消息是,已经有了3.7支持的pull请求。希望能尽快发布。

试试这个:

export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.1-py3-none-any.whl
pip3 install --upgrade $TF_BINARY_URL

来源:https://www.tensorflow.org/get_started/os_setup(页面已不存在)

更新2/23/17 文档移至:https://www.tensorflow.org/install

你可以试试这个

pip install --upgrade tensorflow

如果你的命令pip install——upgrade tensorflowcompililes,那么你的tensorflow版本应该是最新的。我个人更喜欢用水蟒。tensorflow可以简单地安装和升级:

 conda install -c conda-forge tensorflow  # to install
 conda upgrade -c conda-forge tensorflow  # to upgrade

另外,如果你想用你的GPU使用它,你有一个简单的安装:

 conda install -c anaconda tensorflow-gpu

我已经用了一段时间了,从来没有任何问题。