October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

How to Install TensorFlow in Jupyter Notebook

Get TensorFlow running in Jupyter by installing it in a compatible Python environment, registering that environment as a kernel when needed, and verifying it in a notebook cell.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install TensorFlow in the same Python environment that your Jupyter notebook kernel uses. Create or activate a compatible environment, install TensorFlow with pip, register that environment as a Jupyter kernel if it is separate from the notebook server, and then verify the import inside a notebook cell.

1. Check Python and platform compatibility

TensorFlow compatibility changes by release and operating system. Before creating an environment, check the current TensorFlow pip installation guide and its version and build compatibility information for the TensorFlow release, Python version, and platform you plan to use. Do not rely on an old Python-version list: current documentation excerpts can differ as releases change.

As an Amazon Associate I earn from qualifying purchases.

Platform-specific details affect the install command and whether GPU acceleration is available:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Linux: TensorFlow documents CPU and GPU pip installation paths and officially supports Ubuntu. Instructions may work on other Linux distributions. ARM64 Linux CPU builds are maintained and released by AWS as a third-party package.
  • macOS: TensorFlow’s current guide says there is no official GPU support on macOS. Follow its CPU installation route and check the page for current Python compatibility.
  • Windows native: Native Windows GPU support ended with TensorFlow 2.10. For newer GPU configurations, the guide directs users to WSL2. Native Windows can use the CPU route.
  • Windows with WSL2: The guide documents CPU and GPU paths for WSL2. Its GPU instructions specify Windows 10 version 19044 or higher; GPU use also depends on compatible NVIDIA drivers and software.

Use TensorFlow’s operating-system instructions rather than assuming the same GPU setup works on every platform. For a hosted Jupyter notebook without local installation, TensorFlow’s guide identifies Google Colab as an option.

#1 Best Overall

2. Create and activate a virtual environment

TensorFlow recommends Python’s built-in venv for an isolated environment. The commands below use python as the Python executable; on some systems, use the appropriate versioned command, such as python3. Run the activation command for your shell:

  • Linux or macOS: python -m venv .venv, then source .venv/bin/activate.
  • Windows Command Prompt: python -m venv .venv, then .venvScriptsactivate.
  • Windows PowerShell: python -m venv .venv, then .venvScriptsActivate.ps1.

After activation, commands using python and python -m pip refer to this environment. TensorFlow recommends pip for installation; its documentation cautions against installing TensorFlow itself with conda.

3. Install TensorFlow with pip

Upgrade pip, then choose the install path for your platform and hardware:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Run python -m pip install --upgrade pip.
  2. For the usual CPU installation, run python -m pip install tensorflow.
  3. For a supported Linux or Windows WSL2 NVIDIA GPU setup, run python -m pip install 'tensorflow[and-cuda]'. Follow the official platform instructions and compatibility requirements; this command alone does not guarantee that a particular GPU and driver combination is supported.

TensorFlow’s official package is released to PyPI. The GPU path is platform-specific; macOS and native Windows should not use the WSL2 GPU command as though they had the same support.

Rank #3
HP 14" HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam(Renewed)
  • 14” Diagonal HD BrightView WLED-Backlit (1366 x 768), Intel Graphics
  • Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD
  • 1x USB Type C, 2x USB Type A, 1x SD Card Reader, 1x Headphone/Microphone
  • 802.11a/b/g/n/ac (2x2) Wi-Fi and Bluetooth, HP Webcam with Integrated Digital Microphone
  • Windows 11 OS

4. Make the environment available as a Jupyter kernel

If Jupyter runs from the same environment where TensorFlow is installed, select its kernel and proceed to verification. If Jupyter runs from a different Python installation or environment, install and register IPython’s kernel package from the TensorFlow environment. IPython documents this manual registration for separate Python versions and virtual or conda environments in its kernel installation guide.

  1. With the TensorFlow environment activated, run python -m pip install ipykernel.
  2. Register it with python -m ipykernel install --user --name tf --display-name "Python (TensorFlow)".
  3. In Jupyter, select the kernel named Python (TensorFlow) (or the display name you chose). The internal name tf should be unique among your registered kernels.

A Jupyter kernel is the process that executes notebook code, so installing a package in one environment does not make it available to a kernel running another. The Jupyter kernels documentation describes this separation.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

5. Verify TensorFlow inside the notebook

In a notebook cell using the newly selected kernel, run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import tensorflow as tf
print(tf.__version__)

result = tf.reduce_sum(tf.random.normal([1000, 1000]))
print(result)

If the import and calculation succeed, TensorFlow is available and executing in that notebook kernel. To check GPU visibility separately, run:

Best Value
HP 14" HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Blue (Renewed)
  • 14” Diagonal HD BrightView WLED-Backlit (1366 x 768), Intel Graphics,
  • Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD
  • 3x USB Type A,1x SD Card Reader, 1x Headphone/Microphone
  • 802.11a/b/g/n/ac (2x2) Wi-Fi and Bluetooth, HP Webcam with Integrated Digital Microphone
  • Windows 11 OS, Dale Blue
tf.config.list_physical_devices('GPU')

An empty list means TensorFlow does not currently see a GPU; a successful CPU calculation does not establish that GPU support is configured.

Fix “No module named tensorflow” in Jupyter

If TensorFlow imports in a terminal but a notebook reports ModuleNotFoundError, the notebook is likely using a different Python interpreter. In a notebook cell, run:

import sys
print(sys.executable)

Compare that path with the Python executable in the environment where TensorFlow was installed. Select the matching registered kernel, or install and register ipykernel from the TensorFlow environment using the steps above. Installing TensorFlow again in a different environment will not fix a kernel mismatch.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

SaleBestseller No. 1
Bestseller No. 3
HP 14' HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam(Renewed)
HP 14" HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam(Renewed)
14” Diagonal HD BrightView WLED-Backlit (1366 x 768), Intel Graphics; Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD
$239.99
Bestseller No. 5
HP 14' HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Blue (Renewed)
HP 14" HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Blue (Renewed)
14” Diagonal HD BrightView WLED-Backlit (1366 x 768), Intel Graphics,; Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD
$247.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.