Your cart is currently empty!
How to Install TensorFlow on Ubuntu 24.04
If you’re using Ubuntu 24.04 and want to get started with machine learning, TensorFlow is one of the best frameworks to begin with. Whether you’re building neural networks or running pre-trained models, this guide will walk you through installing TensorFlow on your system—no unnecessary steps, just what you need.
Step 1: Update Your System
Open your terminal and make sure your system is up to date:
sudo apt update && sudo apt upgrade -yStep 2: Install Python and pip
Ubuntu 24.04 should come with Python 3.10 or later. Check your version:
python3 --versionIf Python is missing or outdated, install it:
sudo apt install python3 python3-pip -yOptional: Install venv to keep your TensorFlow environment isolated:
sudo apt install python3-venv -yStep 3: Create a Virtual Environment (Recommended)
Create and activate a virtual environment in your project folder:
python3 -m venv tf-env
source tf-env/bin/activateYou’ll know it’s activated when you see (tf-env) in your terminal prompt.
Step 4: Upgrade pip
TensorFlow requires the latest version of pip. Upgrade it with:
pip install --upgrade pipStep 5: Install TensorFlow
Now install TensorFlow. For most users, the CPU version is fine:
pip install tensorflowIf you have an NVIDIA GPU and want to take advantage of it, make sure you’ve installed the correct CUDA and cuDNN libraries, then install:
pip install tensorflow[and-cuda]Note: As of TensorFlow 2.11+, GPU support for Linux comes through the
tensorflow[and-cuda]extra.
Step 6: Test Your Installation
Launch Python:
pythonAnd run the following:
import tensorflow as tf
print("TensorFlow version:", tf.__version__)If everything is working, you should see the TensorFlow version printed without any errors.
Troubleshooting Tips
- Missing dependencies? Run
sudo apt install build-essentialto make sure required compilers and tools are installed. - Using Jupyter? Run
pip install notebookto add notebook support to your environment. - GPU not detected? Double-check your CUDA toolkit version with
nvidia-smiand make sure it matches TensorFlow’s compatibility list.
Conclusion
You’re all set. With TensorFlow installed on Ubuntu 24.04, you can start training models, experimenting with AI, or running ML pipelines. Keep your environment isolated, stay updated, and you’ll avoid most of the common headaches.
Want a tutorial on building your first TensorFlow model? Let me know in the comments.

Tech enthusiast and content creator passionate about making technology simple for everyone. I share practical tips, guides, and reviews on the latest in computers, software, and gadgets. Let’s explore the digital world together!
