Install TensorFlow 2

TensorFlow is tested and supported on the following 64-bit systems:

  • macOS 10.12.6 (Sierra) or later (no GPU support)
  • WSL2 via Windows 10 19044 or higher including GPUs (Experimental)
# Requires the latest pip
pip install --upgrade pip
# Current stable release for CPU pip install tensorflow
# Current stable release for GPU (Linux / WSL2) pip install tensorflow[and-cuda]
# Or try the preview build (unstable) pip install tf-nightly

Download a package

Install TensorFlow with Python's pip package manager.

Official packages available for Ubuntu, Windows, and macOS.

Run a TensorFlow container

The TensorFlow Docker images are already configured to run TensorFlow. A Docker container runs in a virtual environment and is the easiest way to set up GPU support.

dockerpulltensorflow/tensorflow:latest# Download latest stable image
docker run -it -p 8888:8888 tensorflow/tensorflow:latest-jupyter # Start Jupyter server

Google Colab: An easy way to learn and use TensorFlow

No install necessary—run the TensorFlow tutorials directly in the browser with Colaboratory, a Google research project created to help disseminate machine learning education and research. It's a Jupyter notebook environment that requires no setup to use and runs entirely in the cloud. Read the blog post.

Build your first ML app

Create and deploy TensorFlow models on web and mobile.

Web developers

TensorFlow.js is a WebGL accelerated, JavaScript library to train and deploy ML models in the browser, Node.js, mobile, and more.

Mobile developers

TensorFlow Lite is a lightweight solution for mobile and embedded devices.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年07月12日 UTC.