我正在尝试使用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:
$ 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没有任何问题。
当前回答
我也有同样的问题。在卸载32位版本的python并重新安装64位版本后,我尝试重新安装TensorFlow,它工作了。
TensorFlow指南链接:https://www.tensorflow.org/install/install_windows
其他回答
我知道这个问题很老了,但最近我在MacBook Air M1上遇到了这个问题。解决方案是使用pip install tensorflow-macos命令。
我也有同样的问题。在卸载32位版本的python并重新安装64位版本后,我尝试重新安装TensorFlow,它工作了。
TensorFlow指南链接:https://www.tensorflow.org/install/install_windows
注意:这个答案是针对Cygwin用户的
留下这个答案是因为这里的其他方法都不适合我的用例(使用*nix-on-Windows终端环境在virtualenv上安装tensorflow, cygwin (http://www.cygwin.com/))(至少在答案页面上一个简单的控件+F没有找到任何东西)。
TLDR:如果您在cygwin终端上使用virtualenv,请了解cygwin似乎在安装tensorflow时遇到了问题,并抛出了本文问题中指定的错误(可以在这里(https://stackoverflow.com/a/45230106/8236733)找到类似的情绪(类似的原因,不同的错误))。通过在Windows命令提示符中创建virtualenv来解决。然后可以通过source ./Scripts/activate从cygwin终端访问/激活virtualenv,使用Windows的(不是cygwin的)python。
当只是使用cygwin的python3尝试使用tensorflow,例如。之类的……
apt-cyg install python3-devel
cd python-virtualenv-base
virtualenv -p `which python3` tensorflow-examples
发现使用cygwin的python安装tensorflow-gpu包时存在一些问题。看到了错误
$ PIP install tensorflow 收集tensorflow 无法找到满足tensorflow要求的版本 没有找到匹配的分布张量流
有许多建议的解决方案,没有一个对我的情况有帮助(它们通常都是沿着“您可能已经安装了用于32位架构的python3, tensorflow需要64位”或其他一些python不匹配的错误(而在这里,似乎只是cygwin的python安装tensorflow-gpu有问题))。
最后对我有用的是……
通过Windows系统的官方Windows方式安装python3 (cygwin系统是独立的,因此使用不同的python) 在Windows(不是cygwin终端)中打开命令提示符,然后执行…
C:\Users\me\python-virtualenvs-base>python
Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
C:\Users\me\python-virtualenvs-base>pip -V
pip 9.0.1 from c:\users\me\appdata\local\programs\python\python36\lib\site-packages (python 3.6)
C:\Users\me\python-virtualenvs-base>pip install virtualenv
Collecting virtualenv
Downloading https://files.pythonhosted.org/packages/b6/30/96a02b2287098b23b875bc8c2f58071c35d2efe84f747b64d523721dc2b5/virtualenv-16.0.0-py2.py3-none-any.whl (1.9MB)
100% |████████████████████████████████| 1.9MB 435kB/s
Installing collected packages: virtualenv
Successfully installed virtualenv-16.0.0
You are using pip version 9.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
C:\Users\me\python-virtualenvs-base>virtualenv tensorflow-examples
Using base prefix 'c:\\users\\me\\appdata\\local\\programs\\python\\python36'
New python executable in C:\Users\me\python-virtualenvs-base\tensorflow-examples\Scripts\python.exe
Installing setuptools, pip, wheel...done.
然后,可以返回cygwin终端,导航回您在命令提示符中创建的virtualenv,并执行…
➜ tensorflow-examples source ./Scripts/activate
(tensorflow-examples) ➜ tensorflow-examples python -V
Python 3.6.2
(tensorflow-examples) ➜ tensorflow-examples pip install tensorflow-gpu
Collecting tensorflow-gpu
Downloading
....
注意,如果您在cygwin的伪linux环境中创建了virtualenv,那么您不会在virtualenv中执行source ./bin/activate,而是执行source ./Scripts/activate。
我的环境: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
似乎有很多原因导致tensorFlow不能通过pip安装。我在windows 10上遇到的一个问题是,我的系统路径中没有支持的cudnn版本。截至目前(2017年12月),windows上的tensorflow只支持cudnn v6.1。因此,提供cudnn 6.1的路径,如果其他一切都正确,那么应该安装tensorflow。