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


当前回答

摘自tensorflow网站 https://www.tensorflow.org/install/install_windows

Installing with native pip If the following version of Python is not installed on your machine, install it now: Python 3.5.x from python.org TensorFlow only supports version 3.5.x of Python on Windows. Note that Python 3.5.x comes with the pip3 package manager, which is the program you'll use to install TensorFlow. To install TensorFlow, start a terminal. Then issue the appropriate pip3 install command in that terminal. To install the CPU-only version of TensorFlow, enter the following command:

C:\> pip3 install --upgrade tensorflow
To install the GPU version of TensorFlow, enter the following command:

C:\> pip3 install --upgrade tensorflow-gpu

其他回答

我发现TensorFlow 1.12.0只适用于Python 3.5.2版本。我用的是Python 3.7,但它不起作用。所以,我不得不降级Python,然后我可以安装TensorFlow让它工作。

将python版本从3.7降级到3.6

conda install python=3.6.8

如果你正在使用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:该链接中各自的操作系统链接

告诉你具体是什么问题的方法是:

PIP install -vvv tensorflow

这将向您显示可用的轮子文件以及它们不匹配的原因。

如果你执行pip debug -verbose,它会显示所有兼容的标签。

在我的例子中,我试图在一个多通道ubuntu实例的m1 mac上安装tensorflow,而需要https://pypi.org/project/tensorflow-aarch64/

按照以下步骤安装tensorflow和keras:

从https://repo.anaconda.com/archive/下载python 3.6附带的Anaconda3-5.2.0 安装Anaconda并打开Anaconda提示符并执行以下命令 Conda安装jupyter Conda安装scipy PIP安装sklearn PIP安装msgpack PIP安装熊猫 PIP安装panda -datareader PIP安装matplotlib PIP安装枕 PIP安装请求 PIP install h5py PIP安装tensorflow PIP安装keras