For a first deep learning setup, use a Python virtual environment with TensorFlow on the CPU. Check TensorFlow compatibility before choosing a Python version or attempting GPU setup.
What you need
- A compatible Python installation; Python 3.12 is a conservative choice for this guide
- A terminal, code editor and virtual environment
- Enough disk space for TensorFlow and its dependencies
Set up your environment
- Read the current TensorFlow pip installation requirements. Create a folder and run
python -m venv .venvwith the compatible interpreter. - On Windows run
.venv\Scripts\python.exe -m pip install --upgrade pip, then.venv\Scripts\python.exe -m pip install tensorflow. - Save check_dl.py with the tensor operation below. On Linux/macOS use
.venv/bin/pythoninstead of the Windows interpreter path. - Run the check on the CPU first. For GPU training follow the platform-specific TensorFlow guide; modern native Windows GPU support differs from Linux/WSL2.
Your first check
Save as check_dl.py
import tensorflow as tf
print(tf.reduce_sum(tf.constant([1, 2, 3])).numpy())Run or verify
.venv\Scripts\python.exe check_dl.pyExpected result: 6 is printed, possibly after TensorFlow information messages. This confirms an import and tensor calculation.
Common setup problems
- If pip cannot find a compatible build, verify Python version, operating system and architecture against the current requirements.
- Native Windows releases after TensorFlow 2.10 do not provide the same GPU path as Linux/WSL2. Do not install arbitrary CUDA versions without checking compatibility.
Official documentation
Guide reviewed 17 November 2026. Check the linked vendor documentation for current supported versions and operating systems.