Install & Compatibility
Where this runs
tested against v0.5.3 · 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 18.0s · import 3.493s · 526MB
543MB installed
● package 543MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
xrspatial
✓ import xrspatial
✗ from xarray_spatial import xrspatial
The library is imported as 'xrspatial', not as a submodule of xarray_spatial.
focal
✓ from xrspatial import focal
hillshade
✓ from xrspatial import hillshade
Import the library and compute a hillshade from an xarray DataArray.
import xarray as xr
import xrspatial
from xrspatial import hillshade
# Create a sample elevation raster
ds = xr.tutorial.load_dataset('air_temperature').isel(time=0)
elevation = ds['air']
# Compute hillshade
hs = hillshade(elevation)
print(hs)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'xarray_spatial'
Trying to import the wrong name. The correct top-level import is 'xrspatial'.
fixUse 'import xrspatial' or 'from xrspatial import hillshade'.
ImportError: cannot import name 'hillshade' from 'xrspatial'
The function may have been moved or renamed. Check the version documentation.
fixEnsure you have the correct version: 'pip install xarray-spatial[complete]' and import the correct module (e.g., 'from xrspatial import hillshade').
TypeError: 'DataArray' object is not callable
Trying to use a DataArray as a function. Common when mixing up xarray and numpy patterns.
fixEnsure you call the function from xrspatial (e.g., 'hillshade(elevation)') not on the DataArray itself.
Upgrade
Version history
0.10.10latest on PyPI · released Jun 17, 2026
Audit
Dependencies
xarrayrequiredCore data structure
daskrequiredLazy computation and out-of-core
numbarequiredJIT compilation for performance
numpyrequiredArray operations
rioxarrayoptionalGeospatial raster I/O (GeoTIFF, COG)
pyprojoptionalCoordinate transformations
cupyoptionalGPU acceleration via CuPy