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


当前回答

使用Git更容易,他们提供了网站上的方法,但链接访问可能不是很重要,你可以从中读取

引用https://www.tensorflow.org/install/source_windows

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

我的Python版本是3.9.7。我也使用Windows 10,要求如下:

1. Microsoft C++ Retribution installed from Microsoft Visual Studio that matches with x64bits as required in the list.

1.1 Microsoft Visual C++ 2012 Redistribution ( x64 ) and updates    
1.2 Microsoft Visual C++ 2013 Redistributable (x64) - 12.0.40664
1.3 Microsoft Visual C++ 2015-2019 Redistributable (x64) - 14.29.30133
1.4 vs_community__1795732196.1624941787.exe updates

2. Python and AI learning 
tensorboard                2.6.0
tensorboard-data-server    0.6.1
tensorboard-plugin-profile 2.5.0
tensorboard-plugin-wit     1.8.0
***tensorflow                 2.6.0
tensorflow-datasets        4.4.0
tensorflow-estimator       2.6.0
***tensorflow-gpu             2.6.0
tensorflow-hub             0.12.0
tensorflow-metadata        1.2.0
tensorflow-text            2.6.0
***PyOpenGL                   3.1.5
pyparsing                  2.4.7
python-dateutil            2.8.2
python-slugify             5.0.2
python-speech-features     0.6
PyWavelets                 1.1.1
PyYAML                     5.4.1
scikit-image               0.18.3
scikit-learn               1.0.1
***gym                        0.21.0

其他回答

我在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!

我也有这个问题。当查看不同的.whl文件时。我注意到在python 3.7中没有32位版本的tensorflow。最后只能从这里安装64位Python 3.7。

2019年更新: 为了在谷歌Colab中安装TensorFlow 2预览版,您可以使用:

!wget https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64 -O cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
!dpkg -i cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
!apt-key add /var/cuda-repo-10-0-local-10.0.130-410.48/7fa2af80.pub
!apt-get update
!apt-get install cuda
!pip install tf-nightly-gpu-2.0-preview

为了安装TensorFlow 2 bye pip,你可以使用: 为GPU安装tf-night - GPU -2.0-preview PIP安装tf-night -2.0-preview CPU。

通过勾选“添加python到路径”来安装python Pip3安装——升级https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl

这适用于windows 10.0

对于窗口,您可以使用以下命令

python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-2.3.0-cp38-cp38-win_amd64.whl