tensorflow
anaconda
windows installation
machine learning setup
python environment

Installing tensorflow with anaconda in windows

ML System Design practice on Codemia

Design recommenders, ranking systems and training pipelines the way ML interviews actually ask for them, with worked solutions.

Practice ML system design

Introduction

On Windows, the cleanest modern approach is to use Anaconda or Miniconda only for environment management and then install TensorFlow with pip inside that environment. That detail matters, because TensorFlow's official distribution is published to PyPI, and current official guidance recommends pip rather than conda for the TensorFlow package itself.

Create the Conda Environment First

Open Anaconda Prompt and create an isolated environment:

powershell
conda create --name tf python=3.10
conda activate tf

The exact Python version should be one supported by the TensorFlow release you plan to use. The key idea is not the specific version number. The key idea is to keep TensorFlow in its own environment so package conflicts do not leak into unrelated projects.

Install TensorFlow With pip, Not conda

Once the environment is active, upgrade pip and install TensorFlow:

powershell
python -m pip install --upgrade pip
python -m pip install tensorflow

This is the important shift from many older guides. Even if you use Anaconda for environment management, the TensorFlow package itself should generally come from pip.

After installation, verify it:

powershell
python -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"

If a tensor value prints successfully, the CPU installation is working.

Native Windows CPU Versus GPU Support

Current TensorFlow guidance for Windows makes an important distinction:

  • native Windows CPU installs are supported through the Windows pip install tensorflow path
  • native Windows GPU support stops at TensorFlow 2.10
  • for newer GPU-based TensorFlow on Windows, the recommended path is WSL2 rather than native Windows Python

That means most modern Windows users should choose one of these paths:

  1. native Windows plus TensorFlow CPU
  2. WSL2 plus TensorFlow GPU

If you specifically need native-Windows GPU support, you are dealing with older TensorFlow constraints and should confirm version compatibility carefully before installing anything.

Jupyter Notebook in the Same Environment

If you want notebooks, install Jupyter inside the same conda environment:

powershell
python -m pip install jupyter
jupyter notebook

Keeping Jupyter and TensorFlow in the same environment avoids the classic problem where the notebook kernel points to a different interpreter than the one where TensorFlow was installed.

Common Setup Checks

These commands are useful when installation behaves oddly:

powershell
python --version
python -m pip --version
python -c "import sys; print(sys.executable)"

They confirm that the environment is active and that pip is installing into the interpreter you think it is.

Why This Fails So Often

Most Windows TensorFlow install problems come from one of these issues:

  • mixing conda install tensorflow guidance from older tutorials with current pip guidance
  • installing into the wrong environment
  • trying to get modern native-Windows GPU support from a setup that no longer supports it
  • launching Jupyter from outside the TensorFlow environment

When those pieces are aligned, the basic CPU setup is usually straightforward.

Common Pitfalls

The biggest mistake is using Anaconda and then assuming every package should come from conda. For TensorFlow, current official guidance points to pip.

Another issue is creating the conda environment but forgetting to activate it before installation. That sends the package into a different interpreter.

Developers also try to force new GPU TensorFlow setups into native Windows Python when the supported path is now WSL2 for current GPU usage.

Summary

  • Use conda to create the environment, but install TensorFlow itself with pip.
  • Verify the installation inside the same environment where you plan to run your code.
  • Use native Windows for CPU installs and WSL2 for modern GPU installs.
  • Keep Jupyter in the same environment to avoid interpreter mismatches.
  • Most failures come from environment confusion or from following outdated Windows GPU instructions.

Related reading
Free course
Beginner
7 lessons
2 hours
Tackling System Design Interview Problems

A short course that equips you with the skills to approach system design interviews methodically.

Start the free course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

ML System Design practice on Codemia

Design recommenders, ranking systems and training pipelines the way ML interviews actually ask for them, with worked solutions.

Practice ML system design

All Rights Reserved.