我正在尝试使用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网站:“你需要pip 8.1或更高版本才能运行以下命令”。运行这个命令来升级你的pip,然后尝试再次安装tensorflow:

pip install --upgrade pip

其他回答

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

我在OSX Sierra 10.12.2上遇到了这个问题。原来我安装的Python版本是错误的(我安装的是Python 3.4,但OSX的tensorflow pypi包只适用于Python 3.5及以上版本)。

解决方案是安装Python 3.6。下面是我让它工作的方法。注意:我使用Homebrew来安装Python 3.6,你也可以使用python.org上的Python 3.6安装程序来安装

brew uninstall python3
brew install python3
python3 --version # Verify that you see "Python 3.6.0"
pip install tensorflow # With python 3.6 the install succeeds
pip install jupyter # "ipython notebook" didn't work for me until I installed jupyter
ipython notebook # Finally works!

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

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

Python 3.7适合我,我卸载了Python 3.8.1,重新安装了3.7.6。之后,我执行:

pip3 install --user --upgrade tensorflow

这是可行的

安装Python 3.5。x64位amd版本。确保将Python添加到PATH变量中。然后打开命令提示符并键入

python -m pip install --upgrade pip

应该会给你以下结果:

 Collecting pip
 Using cached pip-9.0.1-py2.py3-none-any.whl
 Installing collected packages: pip
 Found existing installation: pip 7.1.2
 Uninstalling pip-7.1.2:
 Successfully uninstalled pip-7.1.2
 Successfully installed pip-9.0.1

现在式

 pip3 install --upgrade tensorflow