Part 7 of 12
TensorFlow and Keras Install Requirements, Explained
ExplainerBy Bot Tutorials · Published · Facts last verified Nov 3, 2026
Part 7: what TensorFlow's pip page says about Python, platforms and GPUs, where it contradicts itself, and a real CPU check with Keras 3.
TensorFlow with its high-level Keras API is the other big deep learning stack alongside PyTorch. Its install rules depend on your operating system, CPU architecture, Python version and, for GPUs, the NVIDIA driver. This explainer walks through what TensorFlow's own pip page says, points out where the page disagrees with itself, and shows a real CPU install check. It's a good example of why you check a bot, and sometimes even the docs, against what actually happens.
What the bot can and can't do here
It can:
- Summarize the install page for your platform.
- Explain the difference between
tensorflow,tensorflow-cpuandtensorflow[and-cuda]. - Read an import error and suggest which requirement is missing.
It can't:
- Know the current supported Python versions. They change with releases.
- Resolve a contradiction in the docs by guessing. Only a real install settles it.
- Set up a GPU it can't see.
Check first, install second
Read the install page for your exact platform, note the versions, then install in a fresh virtual environment.
What the pip page says
When we checked TensorFlow's "Install TensorFlow with pip" page on Nov 3, 2026:
- Packages. Use
tensorflowfor the standard build,tensorflow[and-cuda]on Linux for GPU,tensorflow-cpufor CPU only, andtf-nightlyfor previews. - Linux Arm64. CPU builds for Aarch64 are built and released by AWS as a third party.
- Windows. Native Windows CPU builds come from Intel as a third party. TensorFlow 2.10 was the last release with GPU support on native Windows. For a GPU on Windows, the page points to WSL2, on Windows 10 19044 or higher.
- macOS. No official GPU support.
- GPU software. NVIDIA driver 525.60.13 or later on Linux, CUDA Toolkit 12.3 and cuDNN SDK 8.9.7 are listed for the GPU build.
- CPU. The binaries use AVX instructions, which may not run on older CPUs.
- Conda. The page says not to install TensorFlow with conda, because it may not have the latest stable version.
Where the page disagreed with itself
The Software requirements section listed Python 3.9 to 3.12. Further down, a warning said that as of TensorFlow 2.21 Python 3.9 is no longer supported, suggested 3.10 to 3.13, and the wheel table included Python 3.13 wheels for 2.21.0. We tested the newer claim:
tensorflow 2.21.0 | keras 3.15.1
GPUs: []
final loss 0.0
weight 2.0 bias 1.0
That came from tensorflow-cpu 2.21.0 on Python 3.13.5, so the 3.13 wheels are real. We hid TensorFlow's informational log lines (they go to stderr), which is why only the script's own prints appear.
When docs disagree, trust a real install over either sentence, and tell the bot what you observed:
TensorFlow's pip page lists Python 3.9 to 3.12 in one place and has 3.13 wheels in another. I installed tensorflow-cpu 2.21.0 on Python 3.13.5 and it imported. Given that, which statement is out of date? Don't guess beyond what I've told you.
The check script
import os
os.environ.setdefault("TF_CPP_MIN_LOG_LEVEL", "2")
import tensorflow as tf, keras, numpy as np
print("tensorflow", tf.__version__, "| keras", keras.__version__)
print("GPUs:", tf.config.list_physical_devices("GPU"))
keras.utils.set_random_seed(0)
X = np.linspace(0, 1, 100).reshape(-1, 1).astype("float32")
y = 2 * X + 1
m = keras.Sequential([keras.Input(shape=(1,)), keras.layers.Dense(1)])
m.compile(optimizer=keras.optimizers.SGD(0.5), loss="mse")
h = m.fit(X, y, epochs=50, verbose=0)
print("final loss", round(h.history["loss"][-1], 5))
w, b = m.layers[0].get_weights()
print("weight", round(float(w[0][0]), 2), "bias", round(float(b[0]), 2))
tf.config.list_physical_devices("GPU")returned an empty list, as expected on a CPU-only box. On a working GPU setup it lists your GPUs.- The one-layer Keras model learned
y = 2x + 1with weight 2.0 and bias 1.0, the same check as the PyTorch part. keras.utils.set_random_seed(0)seeds Python, NumPy and the backend together.
Keras 3
Our install came with Keras 3.15.1. TensorFlow's Keras guide is the place to start. Keras 3 can also run on JAX or PyTorch backends, so if a bot shows you code from older tf.keras tutorials, check it against current docs before you rely on it.
GPU setup, documented
For a Linux GPU, the pip page's steps are: install the NVIDIA driver and check it with nvidia-smi, create a venv, pip install tensorflow[and-cuda], then run the GPU check. If no GPU appears, it describes linking NVIDIA libraries in the environment. For older TensorFlow releases, the "Build from source" page has tables of tested Python, compiler, CUDA and cuDNN versions. Use Part 1's checker for the driver floor.
Choosing between TensorFlow and PyTorch
We won't rank them; both are widely used and both have thorough official docs. Practical questions are more useful: which library does the tutorial, course or model you want to use rely on, which one does your team already know, and which one supports your platform? On native Windows with a GPU, for example, TensorFlow's own page points you to WSL2. A bot can list the trade-offs for your situation if you give it your platform and goals, but ask it to cite the install pages for anything about support.
Tested vs documented
- Tested by us:
tensorflow-cpu2.21.0 with Keras 3.15.1 on Python 3.13.5, the GPU list (empty), and the tiny model. - Documented, not tested by us: all GPU, Windows, macOS and Arm64 details, from TensorFlow's pip page.
Where to go next
The next part today tries JAX on the CPU.
Safety, licensing and privacy: read this before you run anything
This series is about learning and small personal projects with machine learning libraries. A bot is a helper, not an authority.
- Check bot advice against official docs. Version numbers, install commands and compatibility tables change often. Compare every answer with the PyTorch, TensorFlow, JAX, scikit-learn, NVIDIA, Hugging Face or ONNX Runtime pages we link. If the bot and the docs disagree, the docs win.
- Work in a virtual environment. Don't install or remove packages in your system Python, and don't run
sudo pip. - Run untrusted files carefully. Pickle-based model files can run code when loaded. Only load models from sources you trust, and prefer safer formats like safetensors where the library supports them.
- Respect licenses. Datasets and model weights carry their own licenses and terms. Read the model card and license before you use, share or sell anything built on them. We don't give legal advice; ask a qualified person if it matters.
- Protect personal data. Don't paste private, customer or medical data into a bot or a training set unless you have the right to, and check the bot's own privacy settings first.
- No hardware claims you didn't measure. Treat any speed figure from a bot as a guess until you've timed it on your own machine.
- No medical, legal or financial decisions from a toy model. These guides are for learning only.
FAQ
Does TensorFlow support GPUs on native Windows?
Not in current versions. TensorFlow's pip page says 2.10 was the last release with GPU support on native Windows, and points to WSL2 instead.
Which Python versions does TensorFlow support?
The pip page wasn't consistent when we checked: one section listed Python 3.9 to 3.12, while a warning said 3.9 was dropped in 2.21 and listed 3.10 to 3.13 with 3.13 wheels. We installed tensorflow-cpu 2.21.0 on Python 3.13.5 and it ran.
Was this tested?
The CPU install and a tiny Keras model ran on our box. GPU setup is documented, not tested by us.
Sources
- TensorFlow: Install TensorFlow with pip
- TensorFlow: Build from source (tested configurations)
- TensorFlow: Keras guide
- NVIDIA: CUDA Toolkit Release Notes
- NVIDIA: CUDA GPU Compute Capability
More in this series
- Part 1: GPU, Driver and CUDA Compatibility: A Bot-Assisted Check · Guide
- Part 2: How Much Memory Does a Model Need? A Data Brief · Data brief
- Part 3: Pin Versions and Build Reproducible ML Environments · Walkthrough
- Part 4: NumPy and pandas Basics with a Bot: Cheat Sheet · Cheat sheet
- Part 5: Your First scikit-learn Model, Built with a Bot · Walkthrough
- Part 6: PyTorch on the CPU: First Steps with a Bot · Guide
- Part 7: TensorFlow and Keras Install Requirements, Explained (you are here) · Explainer
- Part 8: JAX on the CPU: Field Notes with a Bot · Field notes
- Part 9: Read Hugging Face Model Cards and Licenses with a Bot · Guide
- Part 10: Export a Model to ONNX and Run It: A Deep Dive · Deep dive
- Part 11: Read ML Error Messages and Profile Code: Cheat Sheet · Cheat sheet
- Part 12: Review Your Training Code with a Bot: Checklist · Checklist
See the ML Libraries with a Bot series hub · Latest on Bot Tutorials
Bot advice can be wrong. We cite official docs; check them yourself before acting, especially for anything involving money, safety or your data.