Installation

pyTomoAO requires Python 3.9 or newer and runs on Linux, macOS and Windows. It is tested on 3.9 through 3.13.

From PyPI

pip install pyTomoAO

From source

git clone https://github.com/KeckObservatory/pyTomoAO.git
cd pyTomoAO
pip install .

Use an editable install if you intend to modify the code:

pip install -e .

In a fresh environment

Working in an isolated environment avoids clashes with other scientific stacks:

python -m venv .venv
source .venv/bin/activate      # Windows: .venv\Scripts\activate
pip install pyTomoAO
conda create -n pytomoao python=3.11
conda activate pytomoao
pip install pyTomoAO

Dependencies

The following packages are installed automatically:

Package

Used for

numpy

Array handling and linear algebra throughout

scipy

Sparse gradient matrices and the Cholesky solve

numba

JIT-compiled covariance kernels on the CPU path

PyYAML

Reading the configuration file

matplotlib is not installed automatically. It is needed only by visualize_reconstruction, visualize_commands and the display=True branch of set_influence_function, and it is a heavy addition for a machine that only builds reconstructors. Install it with the plot extra below; calling one of those methods without it raises an ImportError naming the extra.

Optional extras

Plotting
pip install "pyTomoAO[plot]"

Adds matplotlib, which the visualisation helpers import on demand.

GPU acceleration
pip install "pyTomoAO[gpu]"

which pulls in CuPy for CUDA 12. On CUDA 11, install the matching wheel yourself instead:

pip install cupy-cuda11x

pyTomoAO detects CuPy at import time and switches to the GPU covariance kernels automatically. If CuPy is installed but fails to load — a driver or toolkit mismatch, or no visible device — pyTomoAO logs a warning with the underlying error and falls back to the CPU backend, rather than silently reporting that CUDA is unavailable. See GPU acceleration.

Documentation toolchain
pip install ".[docs]"

Installs Sphinx, the Furo theme and the MyST/design extensions needed to build this site locally. See Documentation.

Verifying the installation

python -c "import pyTomoAO; print(pyTomoAO.__version__)"

Logging

pyTomoAO logs through the standard logging module and does not configure logging for you — importing it is silent. Turn its messages on from your own code:

import logging

logging.basicConfig(level=logging.INFO)

from pyTomoAO.reconstructor import tomographicReconstructor

You will then see progress messages, including which backend was selected:

INFO:pyTomoAO.reconstructor:
CUDA is not available. Using CPU for computations.

Both backends are fully supported — that message is informational, not an error.

To keep pyTomoAO quiet while your own application logs at INFO:

logging.getLogger("pyTomoAO").setLevel(logging.WARNING)

Next: Quickstart.