Baegopa
Baegopa

Reputation: 11

install tensorflow on python 2.7

I want to install tensorflow on python 2.7 I built environment for python 2.7 on conda(windows 10). but when I try to install tensorflow by "conda install tensorflow", I got a error massage like under.

===========================================================================
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.
===========================================================

when I use pip with [pip install tensorflow], I got massage

========================
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
========================

I already know current tensorflow doesn't support python 2.7, but I still need tensorflow working at python 2.7

what should I do for install tensorflow for python 2.7 at conda environment? It doesn't matter if tensorflow version is 1.0.0 or higher.

Upvotes: 1

Views: 3633

Answers (2)

Shift and Shiftine
Shift and Shiftine

Reputation: 181

conda install tensorflow will still try to fetch the latest stable version of Tensorflow, which again is not compatible with Python 2.7.

But wait, you can ask conda and pip to install a specific version of a package. Using Tensorflow 2.1 (the last supported version for Python 2.7), for example:

  • conda install tensorflow=2.1
  • pip install -Iv tensorflow==2.1 (note the additional equal sign there)

And yes, you can also put that (tensorflow==2.1) into your requirements.txt file too.

Upvotes: 0

user11530462
user11530462

Reputation:

Latest versions of Tensorflow does not support Python2.7

System Requirements

  1. Python 3.6–3.9 Python 3.9 support requires TensorFlow 2.5 or later. Python 3.8 support requires TensorFlow 2.2 or later.
  2. pip 19.0 or later (requires manylinux2010 support)
  3. Ubuntu 16.04 or later (64-bit)
  4. macOS 10.12.6 (Sierra) or later (64-bit) (no GPU support)
  5. macOS requires pip 20.3 or later
  6. Windows 7 or later (64-bit)
  7. Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019
  8. GPU support requires a CUDA®-enabled card (Ubuntu and Windows)

Upvotes: 0

Related Questions