Problem
Two user-guide notebooks render with visible ModuleNotFoundError tracebacks on the live docs site:
| Page |
Error |
| Fire |
ModuleNotFoundError: No module named 'datashader' in cell [1]; every subsequent cell fails with NameError |
| Pathfinding |
Same ModuleNotFoundError: No module named 'datashader' in cell [1]; every subsequent cell fails with NameError |
The other six notebook-based user-guide pages (classification, focal, multispectral, proximity, surface, zonal) build without errors.
Root cause
Both fire.ipynb and pathfinding.ipynb import datashader in their first cell, but datashader is not installed in the ReadTheDocs build environment.
In setup.cfg, datashader is listed only under the examples extra:
[options.extras_require]
examples =
datashader >= 0.15.0
The .readthedocs.yaml installs '.[doc,tests]' in the pre_build step, which does not include datashader:
build:
jobs:
pre_build:
- pip install '.[doc,tests]'
Additionally, docs/source/conf.py has nbsphinx_allow_errors = True, which lets the build succeed but renders the error tracebacks in the published HTML.
Suggested fix
Add datashader to the doc extra in setup.cfg so it is installed whenever the docs are built:
[options.extras_require]
doc =
datashader >= 0.15.0
dask[dataframe]
geopandas
...
Alternatively (or additionally), update .readthedocs.yaml to install the examples extra:
build:
jobs:
pre_build:
- pip install '.[doc,tests,examples]'
The first approach is preferable because it keeps the docs self-contained — anyone running pip install xarray-spatial[doc] locally will get a working build without needing to know about the examples extra.
Environment
Problem
Two user-guide notebooks render with visible
ModuleNotFoundErrortracebacks on the live docs site:ModuleNotFoundError: No module named 'datashader'in cell [1]; every subsequent cell fails withNameErrorModuleNotFoundError: No module named 'datashader'in cell [1]; every subsequent cell fails withNameErrorThe other six notebook-based user-guide pages (classification, focal, multispectral, proximity, surface, zonal) build without errors.
Root cause
Both
fire.ipynbandpathfinding.ipynbimportdatashaderin their first cell, butdatashaderis not installed in the ReadTheDocs build environment.In
setup.cfg,datashaderis listed only under theexamplesextra:The
.readthedocs.yamlinstalls'.[doc,tests]'in thepre_buildstep, which does not includedatashader:Additionally,
docs/source/conf.pyhasnbsphinx_allow_errors = True, which lets the build succeed but renders the error tracebacks in the published HTML.Suggested fix
Add
datashaderto thedocextra insetup.cfgso it is installed whenever the docs are built:Alternatively (or additionally), update
.readthedocs.yamlto install theexamplesextra:The first approach is preferable because it keeps the docs self-contained — anyone running
pip install xarray-spatial[doc]locally will get a working build without needing to know about theexamplesextra.Environment
nbsphinx_allow_errors = Trueindocs/source/conf.py:226