在python 2.7上安装tensorflow



我想在python 2.7上安装tensorflow我在conda(windows 10)上为python 2.7构建了环境。但是当我试图安装tensorflow" conda安装tensorflow",我得到了一个错误的按摩如下。

===========================================================================
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: /
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.-
failed
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- tensorflow -> python[version='3.5.*|3.6.*|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|3.7.*|3.8.*|3.9.*']
Your python: python=2.7
If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.
===========================================================

当我使用pip与[pip安装tensorflow],我得到按摩

========================
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
========================

我已经知道当前tensorflow不支持python 2.7,但我仍然需要tensorflow在python 2.7下工作

我应该怎么做安装tensorflow python 2.7在conda环境?如果tensorflow版本是1.0.0或更高,则无关紧要。

最新版本的Tensorflow不支持Python2.7

系统需求

  1. Python 3.6 - -3.9Python 3.9支持需要TensorFlow 2.5或更高版本。Python 3.8支持需要TensorFlow 2.2或更高版本。
  2. pip 19.0或更高版本(需要manylinux2010支持)
  3. Ubuntu 16.04及以上版本(64位)
  4. macOS 10.12.6 (Sierra)或更高版本(64位)(不支持GPU)
  5. macOS需要pip 20.3或更高版本
  6. Windows 7及以上版本(64位)
  7. Microsoft Visual c++ Redistributable for Visual Studio 2015, 2017和2019年
  8. GPU支持需要CUDA®卡(Ubuntu和Windows)

conda install tensorflow仍将尝试获取最新稳定版本的Tensorflow,该版本仍然与Python 2.7不兼容。

但等等,你可以问condapip安装特定版本包裹的。使用Tensorflow 2.1 (Python 2.7最后支持的版本),例如:

  • conda install tensorflow=2.1
  • pip install -Iv tensorflow==2.1(注意这里额外的等号)

是的,你也可以把它(tensorflow==2.1)放到你的requirements.txt文件中。

相关内容

  • 没有找到相关文章

最新更新