TensorFlow enables your data science, machine learning, and artificial intelligence workflows. This page shows how to install TensorFlow using the conda package manager included in Anaconda and Miniconda.
TensorFlow CPU with conda is supported on 64-bit Ubuntu Linux 16.04 or later and macOS 10.12.6 or later.
TensorFlow GPU with conda is only available though version 2.4.1 (2021). For the latest TensorFlow GPU installation, follow the installation instructions on the TensorFlow website.
Install TensorFlow
-
Open a terminal application and use the default bash shell.
-
Choose a name for your TensorFlow environment, such as “tf”.
-
Use the following commands to install the current release of TensorFlow. CPU-only is recommended for beginners.
TensorFlow is now installed and ready to use.
For using TensorFlow with a GPU, refer to the TensorFlow documentation, specifically the section on device placement.
CUDA versions
GPU TensorFlow uses CUDA. For a version compatibility table for GPU TensorFlow on Linux, see https://www.tensorflow.org/install/source#gpu. For Windows, see https://www.tensorflow.org/install/source_windows#gpu.
GPU TensorFlow conda packages are currently only supported for Windows or Linux.
TensorFlow 2.10 was the last release that supported GPU on Windows Native.
To install GPU TensorFlow with a non-default CUDA version like 9.0, run the following commands:
Nightly builds
Advanced users may wish to install the latest nightly build of TensorFlow. These nightly builds are unstable and are only available as pip packages on PyPI.
To install the nightly build of CPU-only TensorFlow:
Or, to install the nightly build of GPU TensorFlow on Linux or Windows: