我正在尝试使用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没有任何问题。
我正在尝试使用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没有任何问题。
当前回答
至少在我写这篇文章的时候(2020年12月),Tensorflow不支持3.8之后的python版本。使用这个:https://www.tensorflow.org/install来检查它支持哪些python版本,我只是花了几个小时来查看这些答案,花了我很长时间才意识到这一点。
其他回答
我也有这个问题。当查看不同的.whl文件时。我注意到在python 3.7中没有32位版本的tensorflow。最后只能从这里安装64位Python 3.7。
似乎有很多原因导致tensorFlow不能通过pip安装。我在windows 10上遇到的一个问题是,我的系统路径中没有支持的cudnn版本。截至目前(2017年12月),windows上的tensorflow只支持cudnn v6.1。因此,提供cudnn 6.1的路径,如果其他一切都正确,那么应该安装tensorflow。
如果你正在使用Anaconda Python安装,pip install tensorflow将给出上面所述的错误,如下所示:
Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow
根据TensorFlow安装页面,当运行pip install时,你需要使用——ignore-installed标志。
然而,在此之前,请参阅此链接 确保TF_BINARY_URL变量与你想要安装的TensorFlow版本相关的设置正确。
以上答案帮助我解决了我的问题,特别是第一个答案。但在检查python版本之后,我们需要它是64位版本。
根据您拥有的操作系统,我们可以使用以下命令使用pip命令安装tensorflow。
下面的链接有谷歌api链接,可以添加在下面命令的末尾,在您各自的机器上安装tensorflow。
Root命令:python -m pip install——upgrade (link) link:该链接中各自的操作系统链接
我发现这个方法终于管用了。
python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl
编辑1:这是在Windows (8,8.1, 10), Mac和Linux上测试的。根据您的配置将python3更改为python。如果使用Python 2.x,则将url中的py3更改为py2。
编辑2:不同版本的列表,如果有人需要:https://storage.googleapis.com/tensorflow
编辑3:可用轮子包的url列表可在这里: https://www.tensorflow.org/install/pip#package-location