Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unavailable to install Tensorflow 1.x on Ubuntu 20.04 LTS using pip

I have a reason that I should use Tensorflow 1.x release, but it returns an error with message:

ERROR: Could not find a version that satisfies the requirement tensorflow==1.15.2 (from versions: 2.2.0.rc1 ~~~~~
ERROR: No matching disribution found for tensorflow==1.15.2

enter image description here

I also tried .whl installation but the latest Tensorflow 1.15.2 support cp37 which I can't use it anymore.

Is tensorflow 1.x is no longer supported on pip or pypi? Or should I downgrade python(3.8 > 3.7) and install Tensorflow using .whl file?

[System Environment] Ubuntu 20.04 LTS Python version : 3.8.2 pip version : 20.0.2

Thanks.

like image 482
Hyunseo Lee Avatar asked May 15 '20 21:05

Hyunseo Lee


2 Answers


According to tensorflow installation guide tensorflow is available on Python 3.5–3.7 you are using a newer version of Python.


The answer above is outdated

Tensorflow supports Python 3.8 now, but Python 3.8 support requires

  • TensorFlow 2.2 or later
  • pip 19.0 or later
  • Ubuntu 16.04 or later
  • macOS 10.12.6 (Sierra) or later
  • Windows 7 or later
  • Raspbian 9.0 or later

Also GPU support requires a CUDA-enabled card (Ubuntu and Windows)

You can check your Python and pip version with these commands:

python --version | python3 --version
Out: Python 3.8.2

pip --version | pip3 --version
Out: pip 20.1.1

You can upgrade your pip with:

pip install --upgrade pip

More info can be found on this link: Install TensorFlow with pip

like image 66
Yagiz Degirmenci Avatar answered Sep 19 '22 00:09

Yagiz Degirmenci


I would recommend that you avoid installing third-party Python libraries system-wide using pip that will then rely on your system Python. You also really don't want to avoid manually upgrading/downgrading your system Python.

I prefer to use Conda to install TensorFlow. Instructions for installing Conda on Linux are pretty straightforward.

Once you have installed Conda you can install TensorFlow 1.15 with a single command.

conda create --name tensorflow-15 \
    tensorflow-gpu=1.15 \
    cudatoolkit=10.1 \
    cudnn=7.6 \
    nccl=2.4 \ # only relevant if you have more than one GPU
    python=3.6 \
    pip=20.0 

One of the many things I like about Conda is that it provides a single tool to manage environments and packages within a particular environment. It also has a much gentler learning curve compared with other tools for isolating software environments like Docker.

If you are interested in learning more about Conda, then you can check out these teaching materials that I am developing.

https://carpentries-incubator.github.io/introduction-to-conda-for-data-scientists/

like image 42
davidrpugh Avatar answered Sep 19 '22 00:09

davidrpugh