Install & Compatibility
Where this runs
tested against v2.1.17 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
build_error
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 12.3s · import 0.971s · 363MB
369MB installed
● package 369MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Table
✓ from biom import Table
✗ from biom.table import Table
Table is a top-level export; direct submodule import may break in future versions.
load_table
✓ from biom import load_table
Create, save, and load a BIOM table with minimal dependencies.
import numpy as np
from biom import Table, load_table
# Create a simple BIOM table
data = np.array([[1, 2], [3, 4]])
sample_ids = ['S1', 'S2']
obs_ids = ['O1', 'O2']
table = Table(data, obs_ids, sample_ids)
print(table.summary())
# Save to file
table.save('example.biom')
# Load back
loaded = load_table('example.biom')
print(loaded.shape)
Errors
Common errors & fixes
'h5py' is required to read HDF5 BIOM files
biom-format installed without h5py dependency.
fixpip install 'biom-format[hdf5]'
ModuleNotFoundError: No module named 'biom'
Package not installed or installed in wrong environment.
fixpip install biom-format
TypeError: __new__() got an unexpected keyword argument 'observation_metadata'
Mixing old and new API; Table constructor signature changed in 2.0.
fixUse positional args: Table(data, obs_ids, sample_ids) or keyword argument 'observation_ids' and 'sample_ids'.
ValueError: cannot reshape array of size ...
Data array does not match dimensions implied by sample IDs and observation IDs.
fixEnsure `len(obs_ids) * len(sample_ids)` equals total number of elements in data array.
Upgrade
Version history
2.1.17latest on PyPI · released Aug 26, 2025
Audit
Dependencies
h5pyoptionalHDF5 backend for BIOM files
numpyrequiredArray operations on observation/sample data
pandasrequiredDataFrame conversions and table operations
scipyoptionalSparse matrix support