Install & Compatibility
Where this runs
tested against v0.6.11 · 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.95 runs
installs and imports cleanly · install 0.0s · import 0.504s · 146MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 7.0s · import 0.474s · 160MB
159MB installed
● package 159MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SeqRepo
✓ from biocommons.seqrepo import SeqRepo
✗ from seqrepo import SeqRepo
top-level package is biocommons.seqrepo, not seqrepo
SeqRepo
✓ from biocommons.seqrepo import SeqRepo
✗ from biocommons_seqrepo import SeqRepo
hyphenated package name maps to biocommons.seqrepo, not underscore
Basic usage: create a SeqRepo instance pointing to a local seqrepo data directory and fetch sequences by accession.
from biocommons.seqrepo import SeqRepo
# Use a local directory (or set SEQREPO_ROOT_DIR env var)
sr = SeqRepo(root_dir="/path/to/seqrepo", writeable=True)
# Fetch a sequence by NCBI accession (e.g., NM_000558.4)
seq = sr.fetch("NM_000558.4") # returns a SeqRecord
print(seq.id, len(seq.seq))
seqrepo --version
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'biocommons.seqrepo'
Package not installed or installed under a different name.
fixpip install biocommons-seqrepo
AttributeError: module 'biocommons.seqrepo' has no attribute 'SeqRepo'
Outdated version (<0.6.0) or incorrect import path.
fixUpgrade: pip install --upgrade biocommons-seqrepo, then use 'from biocommons.seqrepo import SeqRepo'
ValueError: no sequence found for 'NM_000558'
Accession not present in the local seqrepo data or incorrect version.
fixCheck if the accession exists, include version (e.g., 'NM_000558.4'), and ensure the data directory is up-to-date.
Upgrade
Version history
0.6.11latest on PyPI · released Mar 19, 2025
Audit
Dependencies
psycopg2-binaryoptionalRequired for PostgreSQL-based seqrepo instances (optional if using directory mode only)
biocommons-commonrequiredShared utilities used by seqrepo
typing_extensionsrequiredRequired for type annotations in Python <3.11