Install

How to install Keras (pip + backend)

Installing Keras takes two steps: install the package, then install a backend. Keras 3 needs Python 3.11 or newer.

1. Install Keras

pip install keras

2. Install a backend

pip install tensorflow   # or:  pip install jax   /   pip install torch

3. Choose the backend

Set the environment variable before importing Keras:

export KERAS_BACKEND="jax"

Or in a notebook:

import os
os.environ["KERAS_BACKEND"] = "jax"
import keras
The backend must be set before the first import keras and can't be changed afterward. For GPU builds and exact versions, see the official getting-started guide.

Prefer the raw source? Use the download button on the get-it section — it grabs the official repository zip without leaving the page.

Want the source? Use the get-it section — it stays on-page and links to the official GitHub repository.

Related guides