Documentation

Installation

Install pyINLA and download the INLA binary for your platform.

Install the Python package

pip install pyinla

We recommend using a virtual environment (uv, conda, or venv) to keep dependencies isolated.

The INLA binary

pyINLA is a Python interface to the INLA C/C++ engine. The engine is distributed as a pre-compiled binary and must be downloaded separately after installing the Python package.

Automatic download: The binary is auto-detected and downloaded the first time you run a model. On Linux, pyINLA reads /etc/os-release to pick the correct distro-specific build automatically.

Recommended: Download the binary explicitly before fitting models, especially in Jupyter notebooks or Docker containers, so any network issues are caught early.

Download the binary

Run this once after pip install pyinla:

import pyinla

# Auto-detect your platform and download
pyinla.download_binary()

pyINLA uses a built-in manifest (binaries.json) to select the correct binary for your OS and architecture. On Linux, it reads /etc/os-release to pick a distro-specific build (Ubuntu, Fedora, Rocky, etc.).

To force a re-download (e.g. to update to a newer version):

pyinla.download_binary(force=True)

Supported distros: Ubuntu 22.04/24.04/25.04, Fedora, Rocky 8/9/10, CentOS 7, macOS (Intel and Apple Silicon), Windows. If your distro isn't listed, pyINLA uses the default Linux build.

Debian, Mint, Pop!_OS, etc.: These Ubuntu-based distros are matched automatically to the closest Ubuntu build. If auto-detection fails, use download_binary_from_url() with a specific URL from the R-INLA server (see below).

Browse available binaries See all builds on the R-INLA server
from pyinla.binary import print_remote_binaries

# Show all available builds
print_remote_binaries()

# Filter by distro name
print_remote_binaries("ubuntu")

# Show only the latest version per distro
print_remote_binaries("ubuntu", latest_only=True)

The programmatic version returns a list of dicts:

rows = list_remote_binaries("ubuntu")
for r in rows:
    print(r["distro"], r["arch"], r["version"], r["url"])
Download from a specific URL Use a direct link from R-INLA or a custom build
from pyinla.binary import download_binary_from_url

download_binary_from_url("https://inla.r-inla-download.org/Linux-builds/...")

The URL is typically obtained from print_remote_binaries() or from the R-INLA website. The archive format (.tgz or .zip) is auto-detected.

Command-line tool pyinla-install
# Auto-detect platform and download
pyinla-install

# Force re-download
pyinla-install --force

# Show installed binary info
pyinla-install --info

# Browse R-INLA server listings
pyinla-install --remote
pyinla-install --remote ubuntu --latest

# Download from a specific URL
pyinla-install --url "https://..."

# Link an existing local binary
pyinla-install --link "/path/to/binary"
Troubleshooting Common issues and fixes

Wrong distro detected on Linux

Use print_remote_binaries() to find the correct URL, then download it directly:

from pyinla.binary import print_remote_binaries, download_binary_from_url
print_remote_binaries("rocky", latest_only=True)
download_binary_from_url("https://...", force=True)

Update to a newer version

Pass force=True to re-download:

pyinla.download_binary(force=True)

Architecture mismatch

pyINLA verifies the binary's ELF/PE header after download. If you see an architecture mismatch, use download_binary_from_url() with the correct URL for your platform.

Custom binary path

Use link_binary() (recommended) or set the INLA_BIN environment variable:

import os
os.environ["INLA_BIN"] = "/path/to/inla.mkl.run"
import pyinla

Check what is installed

from pyinla.binary import is_binary_installed, get_binary_version
print(is_binary_installed())   # True / False
print(get_binary_version())    # {'version': '26.02.06', ...}
Quick Reference All functions and CLI flags

Python API

FunctionDescription
pyinla.download_binary()Download binary (auto-detect platform and distro)
pyinla.download_binary(force=True)Force re-download (update to latest)
pyinla.list_available_binaries()Show the built-in manifest (bundled URLs)
pyinla.is_binary_installed()Check if a binary is installed

Additional functions available via from pyinla.binary import ...:

FunctionDescription
download_binary_from_url(url)Download from a specific URL
link_binary(path)Link an existing local binary
print_remote_binaries()Print all builds on the R-INLA server
list_remote_binaries()Get R-INLA server listings as a list of dicts
get_binary_version()Get installed binary version info

CLI (pyinla-install)

CommandDescription
pyinla-installAuto-detect and download binary
pyinla-install --forceForce re-download
pyinla-install --infoShow installed version and manifest
pyinla-install --remote [FILTER]Browse R-INLA server listings
pyinla-install --remote FILTER --latestShow only latest version per distro
pyinla-install --url URLDownload from a specific URL
pyinla-install --link PATHLink an existing local binary

Changelog

Version history and updates for pyINLA.

v0.1.6 Latest

March 2026

Initial public release.

Next Steps