tensorflow
Ubuntu 14.04
installation guide
machine learning
software setup

Install tensorflow on Ubuntu 14.04

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

Installing TensorFlow on Ubuntu 14.04 is a legacy-environment problem, not a modern recommended setup. Ubuntu 14.04 is old enough that recent TensorFlow releases are not a good fit for it, so the practical answer is usually either to use an older CPU-only TensorFlow version in a virtual environment or to avoid native installation entirely and move the workload into a newer container or machine.

Start With the Compatibility Reality

The first thing to understand is that Ubuntu 14.04 is far outside the environment targeted by modern TensorFlow releases. Even if you manage to install some Python packages, you can still run into issues with:

  • old system libraries
  • unsupported Python versions
  • incompatible wheel builds
  • GPU driver and CUDA mismatch

So if the real goal is “run current TensorFlow reliably,” the best answer is to upgrade the operating system or use Docker on a newer base image.

If the real goal is “keep an old Ubuntu 14.04 machine alive long enough to run an older TensorFlow project,” then a legacy install path can still be reasonable.

Create an Isolated Python Environment

On an old system, avoid polluting the system Python. Use a virtual environment:

bash
1sudo apt-get update
2sudo apt-get install -y python3-pip python3-venv
3
4python3 -m venv ~/tf-env
5source ~/tf-env/bin/activate
6python -m pip install --upgrade pip setuptools wheel

This gives you an isolated environment where you can experiment without breaking other Python software on the host.

Install a Legacy TensorFlow Build

For Ubuntu 14.04, a practical approach is usually an older CPU-only TensorFlow release rather than trying to force a recent one.

Example:

bash
pip install "tensorflow==1.15.0"

If that fails because no compatible wheel is available for the Python version in your environment, that is a sign you are in the legacy-compatibility zone where exact Python and package versions matter a lot.

After installation, verify:

bash
1python - <<'PY'
2import tensorflow as tf
3print(tf.__version__)
4PY

If the import works and prints the expected version, the core installation is usable.

Why CPU-Only Is Usually Easier Here

GPU installation on a legacy Linux system is much more fragile because TensorFlow GPU builds depend on exact CUDA and cuDNN versions. On Ubuntu 14.04, that can turn into a chain of compatibility issues:

  • NVIDIA driver version
  • CUDA toolkit version
  • cuDNN version
  • TensorFlow build expectations

For an old machine, CPU-only TensorFlow is usually the quickest stable outcome unless you already know the exact historical GPU stack required by the project.

A Minimal Sanity Check

Once TensorFlow imports, run a tiny computation to verify it is actually usable:

bash
1python - <<'PY'
2import tensorflow as tf
3
4hello = tf.constant("TensorFlow is working")
5with tf.compat.v1.Session() as sess:
6    print(sess.run(hello).decode())
7PY

This example uses TensorFlow 1 style session code because that is the most likely style if you are installing an older version on Ubuntu 14.04.

When Pip Installation Fails

If pip install tensorflow==... fails, the failure usually comes from one of three places:

  1. your Python version does not match available wheels
  2. pip is too old to resolve or install the wheel correctly
  3. the OS is so old that native dependencies are missing or incompatible

You can sometimes fix the second issue with:

bash
python -m pip install --upgrade pip setuptools wheel

The first and third issues are usually signs that a native install is not worth fighting.

A Better Alternative: Use Docker or Another Host

If you only need the code to run and do not specifically need native Ubuntu 14.04 integration, using a container or a newer machine is usually the better engineering choice.

For example, on a newer system you could run:

bash
docker run --rm -it python:3.9 bash

and install a TensorFlow version appropriate for that environment. That avoids most of the dependency problems tied to Ubuntu 14.04 itself.

This is often the smartest path when the old host is kept only for historical reasons.

Common Pitfalls

The biggest pitfall is assuming a current TensorFlow tutorial applies cleanly to Ubuntu 14.04. It usually does not.

Another common issue is trying to solve every installation error by adding more system packages without first confirming that the TensorFlow version, Python version, and wheel availability are even compatible.

GPU installation is another major trap. On a legacy system, CUDA and cuDNN mismatches can consume far more time than the actual machine learning work.

Finally, avoid mixing system Python packages and ad hoc sudo pip install commands. On an old distribution that is an easy way to create a fragile, unreproducible environment.

Summary

  • Ubuntu 14.04 is a legacy environment for TensorFlow, not a recommended modern target.
  • Use a virtual environment and start with an older CPU-only TensorFlow build.
  • Verify the install with both an import test and a small computation.
  • Expect compatibility issues around Python versions and wheel availability.
  • If reliability matters more than preserving the old host, use a newer OS or a container instead.

Course illustration
Course illustration

All Rights Reserved.