Install & Compatibility
Where this runs
tested against v1.12.1 · 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
py 3.10
✕ build_error
✕ build_error
py 3.11
✕ build_error
✓ 10.9s
py 3.12
✕ build_error
✓ 10.9s
py 3.13
✕ build_error
✓ 10.7s
304MB installed
● package 304MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
dipy
✓ import dipy
Top-level import works, but specific submodules must be imported explicitly (e.g., from dipy.io import read_bvals_bvecs)
gtab
✓ from dipy.core.gradients import gradient_table
✗ from dipy.io.gradients import read_bvals_bvecs (not for creating gtab)
gradient_table is in core.gradients
Minimal DTI tensor fitting example. Replace file paths with actual data.
import numpy as np
from dipy.io import read_bvals_bvecs
from dipy.core.gradients import gradient_table
from dipy.reconst.dti import TensorModel
# Load data (example: replace with own files)
# data = nib.load('dwi.nii.gz').get_fdata()
# bvals, bvecs = read_bvals_bvecs('bvals.txt', 'bvecs.txt')
# gtab = gradient_table(bvals, bvecs)
# tenmodel = TensorModel(gtab)
# tenfit = tenmodel.fit(data)
# fa = tenfit.fa
print('DIPY DTI example ready')
dipy --version
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'dipy.dti'
Import path changed after DIPY 1.0.0; old top-level submodules no longer exist.
fixUse from dipy.reconst.dti import TensorModel instead.
AttributeError: module 'dipy' has no attribute 'data'
dipy.data is not automatically imported; need to import explicitly.
fixTry from dipy.data import get_data or import dipy.data as dpd.
ValueError: bvals and bvecs must have same number of volumes
bvals and bvecs files have mismatched lengths or are not aligned properly.
fixRead both files with read_bvals_bvecs and verify shapes. Ensure they correspond to the same DW images.
Upgrade
Version history
1.12.1latest on PyPI · released Apr 23, 2026
Audit
Dependencies
numpyrequiredCore array operations
scipyrequiredScientific computing
nibabelrequiredNeuroimaging file I/O