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:
- 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, thensource .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:
Recommended Free Tools
- Run
python -m pip install --upgrade pip. - For the usual CPU installation, run
python -m pip install tensorflow. - 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
- 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.
- With the TensorFlow environment activated, run
python -m pip install ipykernel. - Register it with
python -m ipykernel install --user --name tf --display-name "Python (TensorFlow)". - In Jupyter, select the kernel named Python (TensorFlow) (or the display name you chose). The internal name
tfshould 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.
Rank #4
5. Verify TensorFlow inside the notebook
In a notebook cell using the newly selected kernel, run:
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteimport 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
- 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.
Quick Recap
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.




