我正在尝试使用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没有任何问题。
当前回答
我发现了问题所在。
我使用的是一台Windows电脑,之前已经安装了Python 2。 安装Python 3后(没有设置路径,我成功检查了pip3的版本-但Python可执行文件仍然指向Python2)
然后我将路径设置为python3可执行文件(删除所有python2路径),然后启动一个新的命令提示符,尝试重新安装Tensorflow。它的工作原理!
我认为这个问题也可能发生在MAC OS上,因为MAC系统上有一个默认的python。
其他回答
对于窗户,这个方法对我很有效,
从这个链接下载车轮。然后从命令行导航到车轮所在的下载文件夹,只需键入以下命令-
PIP安装tensorflow-1.0.0-cp36-cp36m-win_amd64.whl
如果你试图在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
如果你试图在windows机器上安装它,你需要有64位版本的python 3.5。这是真正安装它的唯一方法。来自网站:
TensorFlow仅支持Windows上的64位Python 3.5。我们已经用以下Python发行版测试了pip包: Anaconda的Python 3.5 Python 3.5来自python.org。
你可以从这里下载合适的python版本(确保你选择了一个写着“Windows x86-64”的版本)
现在,您应该能够使用pip install tensorflow或python -m pip install tensorflow进行安装(如果同时安装了python2和python3,请确保您使用的是从python3安装的正确pip)
请记住安装Anaconda 3-5.2.0作为最新版本,即3-5.3.0,包含Tensorflow不支持的python 3.7版本。
这个问题有很多种答案。这个答案旨在概括一组答案:
可能没有一个TensorFlow版本与你的Python版本兼容。如果您使用的是Python的新版本,这一点尤其正确。例如,在Python的新版本发布和该版本的Python的TensorFlow发布之间可能会有延迟。
在这种情况下,我相信你的选择是:
升级或降级到不同版本的Python。(虚拟环境很好,例如conda install python=3.6) 选择与你的python版本兼容的特定版本的tensorflow,例如,如果你仍在使用python3.4: pip install tensorflow==2.0 从源代码编译TensorFlow。 等待一个与你的Python版本兼容的TensorFlow的新版本。
我的环境: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