scikit-bio
raw JSON → 0.7.2 verified Fri May 01 auth: no python
scikit-bio is a Python library for bioinformatics, providing data structures, algorithms, and educational resources. Version 0.7.2 (released 2025-09-15) requires Python >=3.10. Released approximately every 3-6 months, with active development on GitHub.
pip install scikit-bio Common errors
error ModuleNotFoundError: No module named 'skbio.math' ↓
cause The `skbio.math` submodule was deprecated in 0.6.0 and removed.
fix
Use
from skbio.stats import ... instead, e.g., from skbio.stats.distance import permanova. error AttributeError: module 'skbio' has no attribute 'DNA' ↓
cause The top-level `DNA`, `RNA`, `Protein` classes were removed in 0.6.0. Use `skbio.sequence.DNA` instead.
fix
Use
from skbio.sequence import DNA or skbio.sequence.DNA. Warnings
breaking scikit-bio 0.6.0 introduced major API changes and deprecations. Code written for 0.5.x may require updates, especially in sequence I/O and tree modules. ↓
fix Review the migration guide in the changelog: https://github.com/scikit-bio/scikit-bio/blob/main/CHANGELOG.md
deprecated The `skbio.math` submodule is deprecated. Use `skbio.stats` or `scipy` instead. ↓
fix Replace imports like `from skbio.math import ...` with `from skbio.stats import ...` or use scipy directly.
gotcha DistanceMatrix in scikit-bio 0.7.x is a condensed form by default. Indexing with [i][j] may give unexpected results. Use `dm[i, j]` syntax. ↓
fix Always use `dm[row, col]` instead of `dm[row][col]`.
Imports
- DistanceMatrix wrong
import skbio.stats.distance.DistanceMatrixcorrectfrom skbio import DistanceMatrix - TreeNode wrong
from skbio.tree import TreeNodecorrectfrom skbio import TreeNode
Quickstart
from skbio import DistanceMatrix, TreeNode
dm = DistanceMatrix([[0, 1, 2], [1, 0, 3], [2, 3, 0]], ids=['a', 'b', 'c'])
print(dm)
tree = TreeNode.read(['((a,b),c);'])
print(tree.ascii_art())