# WeatherNext Dependencies: Complete Installation Guide for Google's AI Weather Model

> Install Google's WeatherNext AI model. Learn about essential dependencies like JAX, Haiku, Xarray, and Dask. Get your complete installation guide now.

- Repository: [Google DeepMind/weathernext](https://github.com/google-deepmind/weathernext)
- Tags: how-to-guide
- Published: 2026-08-16

---

**WeatherNext requires 20 core Python packages including JAX, Haiku, Xarray, and Dask, all declared in [`setup.py`](https://github.com/google-deepmind/weathernext/blob/main/setup.py) and installed automatically via `pip install weathernext`.**

WeatherNext is Google DeepMind's state-of-the-art neural network for weather forecasting. To run the model, train new variants, or integrate it into research workflows, you need to understand what dependencies power its GPU-accelerated simulations and data processing pipelines. This guide breaks down every package declared in the repository's [`setup.py`](https://github.com/google-deepmind/weathernext/blob/main/setup.py) [L32-L54](https://github.com/google-deepmind/weathernext/blob/main/setup.py) and explains how each contributes to the system.

## Core Machine Learning Stack

The WeatherNext architecture builds on DeepMind's JAX ecosystem for high-performance numerical computing. These four dependencies form the computational backbone:

- **JAX** — Core just-in-time compiled arrays with GPU/TPU acceleration. All tensor operations in [`weathernext/weathernext2/architecture.py`](https://github.com/google-deepmind/weathernext/blob/main/weathernext/weathernext2/architecture.py) execute through JAX.

- **dm-haiku** — DeepMind's neural network library for JAX. Transforms and layers throughout the model code use Haiku's functional API.

- **jax** — Repeated explicitly in dependencies for version pinning. The repository requires a compatible JAX installation for its GPU kernels.

- **chex** — Testing utilities and runtime assertions for JAX code, used in unit tests and validation checks.

## Weather and Climate Data Processing

WeatherNext processes massive multi-dimensional datasets using labeled arrays and lazy loading. These dependencies handle the data layer:

- **xarray<=2026.2.0** — Labeled N-dimensional arrays are the primary data container. The version cap ensures compatibility with `gdm-xarray-jax`.

- **gdm-xarray-jax** (`git+https://github.com/google-deepmind/xarray_jax.git@v0.1.1`) — Bridges Xarray structures with JAX for GPU-accelerated weather data processing without copying between formats.

- **xarray_tensorstore** — Enables lazy, out-of-core loading of datasets too large for memory. Critical for training on decades of reanalysis data.

- **dask** — Parallel computing scheduler that Xarray uses for distributed operations across multiple CPU cores or cluster nodes.

- **h5netcdf** — Reads and writes NetCDF/HDF5 files, the standard format for ERA5 and other climate datasets.

## Physical Simulation Components

WeatherNext couples neural networks with traditional physics through specialized dynamical cores:

- **dinosaur-dycore** — Implements the DyCORE dynamical core powering WeatherNext's physical simulations. This package handles the fluid dynamics integrated with learned components.

- **trimesh** — 3-D mesh processing for the icosahedral Earth representation. WeatherNext uses spherical meshes rather than latitude-longitude grids.

- **jraph** — Graph neural network library built on JAX. Powers the graph-based message passing in spatial attention layers.

## Configuration and Utilities

Model composition and infrastructure utilities enable flexible experimentation:

- **fiddle** — Configuration library for composing and modifying hyperparameters. JSON configs in `weathernext/weathernext2/configs/` load through Fiddle's DAG-based system.

- **dm-tree** — Tree utilities for flattening and mapping nested model parameters. Essential for optimizer state handling and checkpoint serialization.

- **typing_extensions** — Back-ports modern type hints for Python 3.8+ compatibility.

## Geographic and Scientific Computing

Spatial operations and coordinate transformations require specialized libraries:

- **pyproj** — Geographic projection utilities converting between coordinate reference systems.

- **rtree** — Spatial indexing for fast geographic queries on irregular regions.

- **scipy** — Scientific routines including interpolation and optimization used in preprocessing.

## Visualization and Interface

Output analysis and demonstration capabilities:

- **matplotlib** — Plotting forecasts and diagnostics. The demo notebook `docs/weathernext2/wn2_demo.ipynb` relies on this for figure generation.

- **pandas** — Tabular data manipulation, notably for CSV-based cyclone trackers and metadata handling.

- **numpy** — Fundamental arrays required by downstream packages throughout the stack.

- **colabtools** — Google Colab integration utilities for running demonstration notebooks.

## Installing WeatherNext

### Standard Installation

```bash
pip install weathernext

```

This command installs all 20 dependencies automatically from [`setup.py`](https://github.com/google-deepmind/weathernext/blob/main/setup.py).

### Installation from Source

```bash
git clone https://github.com/google-deepmind/weathernext.git
cd weathernext
pip install -e .

```

Editable mode (`-e`) lets you modify the codebase while maintaining dependency resolution.

### Verifying Your Installation

```python

# Example 1 – Load a WeatherNext model configuration

import weathernext.weathernext2 as wn2

config = wn2.load_config("WeatherNext2.json")
model = wn2.build_model(config)

```

```python

# Example 2 – Run a forecast on an xarray dataset

import xarray as xr
import weathernext.utils.model_utils as mu

ds = xr.open_dataset("sample_era5.nc")
forecast = mu.run_forecast(model, ds, steps=24)  # 24-hour forecast

```

```python

# Example 3 – Visualise a forecast field with matplotlib

import matplotlib.pyplot as plt

plt.figure()
forecast["air_temperature"].isel(time=0).plot()
plt.title("24-h Forecast – Air Temperature")
plt.show()

```

## Key Files for Dependency Understanding

| File | Role |
|------|------|
| [`setup.py`](https://github.com/google-deepmind/weathernext/blob/main/setup.py) [L32-L54](https://github.com/google-deepmind/weathernext/blob/main/setup.py) | Declares all runtime dependencies |
| [`weathernext/weathernext2/architecture.py`](https://github.com/google-deepmind/weathernext/blob/main/weathernext/weathernext2/architecture.py) | Core model wiring JAX/Haiku components |
| [`weathernext/utils/model_utils.py`](https://github.com/google-deepmind/weathernext/blob/main/weathernext/utils/model_utils.py) | Forecast execution utilities |
| `docs/weathernext2/wn2_demo.ipynb` | End-to-end demonstration notebook |

## Summary

- **WeatherNext dependencies are declared in [`setup.py`](https://github.com/google-deepmind/weathernext/blob/main/setup.py)** and install automatically via pip
- **JAX + Haiku** provide the GPU-accelerated machine learning foundation
- **Xarray + gdm-xarray-jax** enable labeled, GPU-ready weather data structures
- **dinosaur-dycore + trimesh** power the physical simulation on icosahedral meshes
- **20 total packages** cover ML, data, physics, config, and visualization needs

## Frequently Asked Questions

### Does WeatherNext work without a GPU?

WeatherNext runs on CPU but requires JAX's CPU backend. Performance degrades significantly without GPU or TPU acceleration. The `jax` package [installed via [`setup.py`](https://github.com/google-deepmind/weathernext/blob/main/setup.py)](https://github.com/google-deepmind/weathernext/blob/main/setup.py) detects available hardware automatically.

### Why is xarray pinned to <=2026.2.0?

The version constraint ensures compatibility with `gdm-xarray-jax`, which implements custom JAX primitives for Xarray operations. Newer Xarray versions may break these bridge functions. Monitor the [gdm-xarray-jax repository](https://github.com/google-deepmind/xarray_jax) for updates.

### Can I use WeatherNext without installing all visualization dependencies?

Core forecasting works without `matplotlib` if you remove it from a local fork of [`setup.py`](https://github.com/google-deepmind/weathernext/blob/main/setup.py). However, the demo notebooks and most example scripts in `docs/` require matplotlib for output display. For headless server deployment, install with `pip install weathernext` then uninstall matplotlib if disk space is constrained.

### What Python versions are supported?

The `typing_extensions` dependency suggests Python 3.8+ support with back-ported type hints. According to the source code, the repository targets modern Python versions compatible with JAX's release schedule. Check the repository's CI configuration for current version matrices.