I am trying to install TensorFlow 2.16.1 on my Ubuntu 22.04 system using pip, but I keep encountering an error saying that no matching distribution is found. Below are the details of my system:
- OS: Ubuntu 22.04.4 LTS
- Python Version: 3.10.12
- Architecture: x86_64
- Pip Version: 24.0
When I try to use the command pip install tensorflow
, it installs version 2.13.1, but I need version 2.16.1.
Here are the commands and outputs from my terminal:
(base) aria@laptop:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy
(base) aria@laptop:~$ python --version
Python 3.10.12
(base) aria@laptop:~$ uname -m
x86_64
(base) aria@laptop:~$ pip --version
pip 24.0 from /home/aria/anaconda3/lib/python3.8/site-packages/pip (python 3.8)
(base) aria@laptop:~$ pip install --upgrade tensorflow==2.16.1
ERROR: Could not find a version that satisfies the requirement tensorflow==2.16.1 (from versions: 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0, 2.10.1, 2.11.0rc0, 2.11.0rc1, 2.11.0rc2, 2.11.0, 2.11.1, 2.12.0rc0, 2.12.0rc1, 2.12.0, 2.12.1, 2.13.0rc0, 2.13.0rc1, 2.13.0rc2, 2.13.0, 2.13.1)
ERROR: No matching distribution found for tensorflow==2.16.1
Additionally, I also tried to install TensorFlow using the wheel file from this page by executing the following command:
(base) aria@laptop:~/Downloads$ pip install tensorflow_cpu-2.16.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
ERROR: tensorflow_cpu-2.16.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl is not a supported wheel on this platform.
I have verified that my system meets the necessary requirements for installing TensorFlow. However, it appears that TensorFlow 2.16.1 is not found in the available versions, and the wheel file installation also fails.
I do not have a GPU, so I am trying to install the CPU version of TensorFlow.
I would appreciate any guidance on how to resolve this issue. Is there a specific repository I need to add, or is there another way to install TensorFlow 2.16.1 on my setup?
Thank you!
2
Answers
Try running directly without
--upgrade
Like this:
Yes, there was a problem installing
tensorflow 2.16
for Ubuntu.Please see the links for the solution.
https://discuss.tensorflow.org/t/tensorflow-version-2-16-just-released/23140
https://github.com/tensorflow/tensorflow/issues/63362
If you want to use 2.16.1 and you use conda then the easiest fix is with activated env:
create file in
${CONDA_PREFIX}/etc/conda/activate.d/fix_gpu.sh
with content below: