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


当前回答

如果您尝试了上面的解决方案,但没有解决问题,可能是因为版本不一致。

我安装了python 3.9,无法用pip安装tensorflow。

然后我卸载了3.9,然后安装了3.8.7,成功…tensorflow支持的最大版本是3.8。X(2021年) 所以,检查你的python版本是否与当前的tensorflow兼容。

其他回答

目前PIP没有32位版本的tensorflow,当我卸载python 32位并安装x64时,它可以工作

我的环境:Win 10, python 3.6

pip3 install --upgrade tensorflow
pip install --upgrade tensorflow

错误:

> Collecting tensorflow Could not find a version that satisfies the
> requirement tensorflow (from versions: ) No matching distribution
> found for tensorflow

我还尝试了pip install tensorflow和pip install tensorflow-gpu。 但错误:

> Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow
> Could not find a version that satisfies the requirement tensorflow-gpu (from versions: ) No matching distribution found for tensorflow-gpu

使用Step (https://www.tensorflow.org/install/install_windows)尝试安装OK

Follow the instructions on the Anaconda download site to download and install Anaconda. https://www.continuum.io/downloads Create a conda environment named tensorflow by invoking the following command: C:> conda create -n tensorflow pip python=3.5 Activate the conda environment by issuing the following command: C:> activate tensorflow (tensorflow)C:> # Your prompt should change Issue the appropriate command to install TensorFlow inside your conda environment. To install the CPU-only version of TensorFlow, enter the following command: (tensorflow)C:> pip install --ignore-installed --upgrade tensorflow To install the GPU version of TensorFlow, enter the following command (on a single line): (tensorflow)C:> pip install --ignore-installed --upgrade tensorflow-gpu

以下是我为Windows 10所做的!我也没有打扰之前的Python 2.7安装

步骤1:从链接安装Windows x86-64可执行安装程序: https://www.python.org/downloads/release/python-352/

步骤2:以管理员身份打开cmd

步骤3:输入以下命令:

pip install https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl

您应该看到它可以正常工作,如下图所示,我还尝试了示例示例。

如果你试图在Windows上安装Anaconda Tensorflow,一个免费的建议是请卸载Anaconda,并从发布页面下载一个64位的Python版本,以amd64结尾。对我来说,它是python-3.7.8-amd64.exe

然后按照Tensorflow官方网站上的说明在虚拟环境中安装Tensorflow。

如果你试图在anaconda中安装tensorflow,但它不起作用,那么你可能需要降级python版本,因为只有3.6。目前支持X,而anaconda有最新版本。

检查python版本:python——version 如果>版本为3.6. exe。X则按照步骤3,否则停止,问题可能在其他地方 Conda搜索python Conda install python=3.6.6 再次检查版本:python——version 如果版本正确,安装tensorflow(步骤7) PIP安装tensorflow