我正在尝试使用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,如下所示

# Requires the latest pip
pip install --upgrade pip

# Current stable release for CPU and GPU
pip install tensorflow

如果你使用蟒蛇提示,那么试试这个

conda install -c anaconda tensorflow-gpu

其他回答

安装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

我也面临着同样的问题。我尝试了下面的方法,它奏效了。 安装Mac OS X, anaconda python 2.7

PIP卸载tensorflow export TF_BINARY_URL=<从http://tflearn.org/installation/>得到正确的url pip install——upgrade $TF_BINARY_URL

安装tensorflow-1.0.0

我知道这个问题很老了,但最近我在MacBook Air M1上遇到了这个问题。解决方案是使用pip install tensorflow-macos命令。

2.0兼容方案:

在终端(Linux/MacOS)或命令提示符(Windows)中执行以下命令,使用Pip安装Tensorflow 2.0:

#Install tensorflow using pip virtual env 
pip install virtualenv
virtualenv tf_2.0.0   # tf_2.0.0 is virtual env name
source tf_2.0.0/bin/activate
#You should see tf_2.0.0 Env now. Execute the below steps
pip install tensorflow==2.0.0
python
>>import tensorflow as tf
>>tf.__version__
2.0.0

在终端(Linux/MacOS)或命令提示符(Windows)中执行以下命令,使用Bazel安装Tensorflow 2.0:

git clone https://github.com/tensorflow/tensorflow.git
cd tensorflow

#The repo defaults to the master development branch. You can also checkout a release branch to build:
git checkout r2.0

#Configure the Build => Use the Below line for Windows Machine
python ./configure.py 

#Configure the Build => Use the Below line for Linux/MacOS Machine
./configure
#This script prompts you for the location of TensorFlow dependencies and asks for additional build configuration options. 

#Build Tensorflow package

#CPU support
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package 

#GPU support
bazel build --config=opt --config=cuda --define=no_tensorflow_py_deps=true //tensorflow/tools/pip_package:build_pip_package

对于窗户,这个方法对我很有效,

从这个链接下载车轮。然后从命令行导航到车轮所在的下载文件夹,只需键入以下命令-

PIP安装tensorflow-1.0.0-cp36-cp36m-win_amd64.whl