tensorflow: Cannot find any way to install tensorflow<=2.15.0

Issue type

Bug

Have you reproduced the bug with TensorFlow Nightly?

Yes

Source

source

TensorFlow version

2.15.0

Custom code

Yes

OS platform and distribution

Ubuntu 22.04.3

Mobile device

No response

Python version

3.11

Bazel version

No response

GCC/compiler version

No response

CUDA/cuDNN version

No response

GPU model and memory

No response

Current behavior?

I want to install tensorflow in python and also then serve a model in a rust application. Since the only c++ bindings are for 2.15.0 (I cannot find any other compiled versions without building from source…which I tried and failed to do), I have to install tensorflow 2.15.0. I tried installing tensorflow 2.15.1 and training a model but the c++ bindings complain the model was trained using a version later than the c++ bindings (which is true)…so I assume I have to install tensorflow 2.15.0 or lower:

pip install "tensorflow==2.15.0"
ERROR: Could not find a version that satisfies the requirement tensorflow==2.15.0 (from versions: 2.16.0rc0, 2.16.1)
ERROR: No matching distribution found for tensorflow==2.15.0

or

pip install "tensorflow<=2.15.0"
ERROR: Could not find a version that satisfies the requirement tensorflow<=2.15.0 (from versions: 2.16.0rc0, 2.16.1)
ERROR: No matching distribution found for tensorflow<=2.15.0

I then tried to install 2.15 from source but since I don’t have 3 phds I cannot decipher the reasons why it fails (after taking 4 hours to download, unzip and then compile).

I’m at a total loss at what to do… if there was just a wheel available for some version below 2.15.1 or just more compiled c++ bindings available for something other than 2.15.0 then I could not be wasting my time.

The problem is even worse if I try and use and-cuda (but one thing at a time?).

Standalone code to reproduce the issue

pip install "tensorflow<=2.15.0"

Relevant log output

ERROR: Could not find a version that satisfies the requirement tensorflow<=2.15.0 (from versions: 2.16.0rc0, 2.16.1)
ERROR: No matching distribution found for tensorflow<=2.15.0

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (5 by maintainers)

Most upvoted comments

I landed in this page while working on a device with TF 2.15 dependency. tensorflow[and-cuda]==2.15.0 caused various conflicts when I tried, 2.15.1 works instead. In case anyone needs, the following installation worked for me (it can be made simpler in several ways, e.g. one can skip conda and use pip/uv environment):

conda update -n base -c defaults conda
conda install mamba -n base -c conda-forge

mamba create --name $new_env_name --channel conda-forge  --channel nvidia --channel defaults python=3.9 
conda activate "$new_env_name"

pip install "tensorflow[and-cuda]>=2.15.0,<2.16"

Then, using the following code

import tensorflow as tf
print("TensorFlow version:", tf.__version__)
cuda_available = tf.test.is_built_with_cuda()
print(f"TensorFlow was built with CUDA: {cuda_available}")
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
gpu_devices = tf.config.list_physical_devices('GPU')
print("GPU Devices:", gpu_devices)

I get:

TensorFlow version: 2.15.1  
TensorFlow was built with CUDA: True
2025-04-12 10:29:47.682531: I external/local_xla/xla/stream_executor/cuda/cuda_executor.cc:901] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2025-04-12 10:29:47.697516: I external/local_xla/xla/stream_executor/cuda/cuda_executor.cc:901] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2025-04-12 10:29:47.697608: I external/local_xla/xla/stream_executor/cuda/cuda_executor.cc:901] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
Num GPUs Available:  1
GPU Devices: [PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]